« Home « Chủ đề chủ đề và giao diện

Chủ đề : chủ đề và giao diện


Có 140+ tài liệu thuộc chủ đề "chủ đề và giao diện"

Professional ASP.NET 3.5 in C# and Visual Basic Part 120

tailieu.vn

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) If (Not Page.IsPostBack) Then. For Each drive As System.IO.DriveInfo In System.IO.DriveInfo.GetDrives() Dim node As TreeNode = New TreeNode(). node.Text = drive.Name &. Me.TreeView1.Nodes.Add(node) Next. Me.TreeView1.CollapseAll(). Private Sub LoadDirectories(ByVal parent As TreeNode, ByVal path As String) Dim directory As System.IO.DirectoryInfo. New System.IO.DirectoryInfo(path) Try. For Each d As System.IO.DirectoryInfo In directory.GetDirectories() Dim...

Professional ASP.NET 3.5 in C# and Visual Basic Part 121

tailieu.vn

System.IO.FileInfo file = new System.IO.FileInfo(Server.MapPath("TextFile.txt"));. file.FullName + "<BR>");. file.Length + "<BR>");. file.CreationTime + "<BR>");. file.LastWriteTime + "<BR>");. file.LastAccessTime + "<BR>");. file.Attributes);. ACLs are the way resources such as directories and files are secured in the NTFS file system, which is the file system used by Windows XP, NT and 2003. You can view a file’s ACLs by selecting the Security...

Professional ASP.NET 3.5 in C# and Visual Basic Part 122

tailieu.vn

Dim data() As Byte = System.Text.Encoding.ASCII.GetBytes("This is a string") Dim ms As New System.IO.MemoryStream(). byte[] data = System.Text.Encoding.ASCII.GetBytes("This is a string");. System.IO.MemoryStream ms = new System.IO.MemoryStream();. Dim client As New System.Net.Sockets.TcpClient(). Dim addr As System.Net.IPAddress = System.Net.IPAddress.Parse Dim endpoint As New System.Net.IPEndPoint(addr, 23). Dim ns As System.Net.Sockets.NetworkStream = client.GetStream() If (ns.DataAvailable) Then. Dim response As String = System.Text.Encoding.ASCII.GetString(data) End If....

Professional ASP.NET 3.5 in C# and Visual Basic Part 123

tailieu.vn

string encodings = app.Request.Headers.Get("Accept-Encoding");. Stream s = app.Response.Filter;. app.Response.Filter = new GZipStream(s, CompressionMode.Compress);. app.Response.AppendHeader("Content-Encoding gzip");. app.Response.Filter. app.Response.AppendHeader("Content-Encoding deflate");. Do this by adding the module to the web.config file. Listing 25-23 shows the nodes to add to the web.config system.web configuration section.. Listing 25-23: Adding an HttpCompression module to the web.config. Figure 25-14. Also introduced in the .NET 2.0 Framework was...

Professional ASP.NET 3.5 in C# and Visual Basic Part 124

tailieu.vn

Listing 25-29: Sending mail from a Web page. New System.Net.Mail.MailMessage("[email protected] [email protected]") message.Subject = "Sending Mail with ASP.NET 3.5". "This is a sample email which demonstrates sending email using ASP.NET 3.5". Dim smtp As New System.Net.Mail.SmtpClient("localhost") smtp.Send(message). System.Net.Mail.MailMessage message. new System.Net.Mail.MailMessage("[email protected]","[email protected]");. message.Subject = "Sending Mail with ASP.NET 3.5";. "This is a sample email which demonstrates sending email using ASP.NET 3.5";. System.Net.Mail.SmtpClient...

Professional ASP.NET 3.5 in C# and Visual Basic Part 125

tailieu.vn

CType(c1, WebUserControl).Text = "My users controls text". ’The control is participating in output cache, but has expired Dim myWebUserControl as WebUserControl. myWebUserControl.ID = "myWebUserControl1". myWebUserControl.Text = "My users controls text". //This control is not participating in OutputCache ((WebUserControl)c1).ID = "myWebUserControl1";. ((WebUserControl)c1).Text = "My users controls text";. //The control is participating in output cache, but has expired WebUserControl myWebUserControl. myWebUserControl.ID =...

Professional ASP.NET 3.5 in C# and Visual Basic Part 126

tailieu.vn

Bindable Indicates that the property can be bound to a data source Browsable Indicates whether the property should be displayed at. design time in the Property Browser. Category Indicates the category this property should be displayed under in the Property Browser. Description Displays a text string at the bottom of the Property Browser that describes the purpose of the property....

Professional ASP.NET 3.5 in C# and Visual Basic Part 127

tailieu.vn

Listing 26-18: Sample ASP.NET skin. Return "[". Adding Client-Side Features. Although the capability to render and style HTML is quite powerful by itself, other resources can be sent to the client, such as client-side scripts, images, and resource strings. ASP.NET 3.5 provides you with some powerful new tools for using client-side scripts in your server controls and retrieving other resources...

Professional ASP.NET 3.5 in C# and Visual Basic Part 128

tailieu.vn

ASP.NET includes some powerful tools you can use to detect the type and version of the browser making the page request, as well as what capabilities the browser supports.. ASP.NET 2.0 introduced a new and highly flexible method for configuring, storing, and discov- ering browser capabilities. ASP.NET stores these files in the C. Windows \ Microsoft.NET \ Framework \ v2.0.[xxxx....

Professional ASP.NET 3.5 in C# and Visual Basic Part 129

tailieu.vn

Now that you can create a postback, you may want to add events to your control that execute dur- ing the page postback. To raise server-side events from a client-side object, you implement the Sys- tem.Web.IPostBackEventHandler interface. Listing 26-31 shows how to do this for a button control. You also create a server-side Click event you can handle when the...

Professional ASP.NET 3.5 in C# and Visual Basic Part 130

tailieu.vn

this.Controls.Clear();. Controls.Add(_message);. This property allows Visual Studio to understand that the control can contain a template, and allows it to display the IntelliSense for that template. The property has been marked with the PersistanceMode attribute indicating that the template control should be persisted as an inner property within the control’s tag in the ASPX page.. Additionally, the property is marked...

Professional ASP.NET 3.5 in C# and Visual Basic Part 131

tailieu.vn

If (_currentView = 1) Then template = View2 End If. Dim p As New Panel() Controls.Add(p). If (Not template Is Nothing) Then template.InstantiateIn(p) End If. ">". "</{0}:MultiRegionControl>")]. Define the templates that represent 2 views on the control private ITemplate _view1;. The current view on the control. Controls.Add(p);. The ITemplate objects are the control containers for this server control, allowing you...

Professional ASP.NET 3.5 in C# and Visual Basic Part 132

tailieu.vn

DesignerActionTextItem is added to the collection (see Figure 26-18). The DesignerActionTextItem class allows you to add text menu items to the smart tag.. One type of UI type editor you might already be familiar with is the Color Picker you see when you want to change the ForeColor attribute that exists on most ASP.NET con- trols. ASP.NET provides a wide...

Professional ASP.NET 3.5 in C# and Visual Basic Part 133

tailieu.vn

The generic format of the httpModules section is. the <system.webServer>. If you have created your HttpModule in the App_Code directory of an ASP.NET web site, you might wonder how you know what the assemblyname value should be, considering ASP.NET now dynamically compiles this code at runtime. This tells ASP.NET that your module is located in the dynamically created assembly.. You...

Professional ASP.NET 3.5 in C# and Visual Basic Part 134

tailieu.vn

As you can see, you simply change the ContentType to image/jpeg to indicate that you are returning a JPEG image. Although this sample is simple, you can enhance it by passing querystring parameters to your han- dler and using them to perform additional logic in the handler. For instance, you can pass an ID in to dynamically retrieve an image...

Professional ASP.NET 3.5 in C# and Visual Basic Part 135

tailieu.vn

Runtime Callable Wrapper (RCW) .NET Code. (C# or VB.NET). (COM Component) Your New .NET. Figure 28-6. The Runtime Callable Wrapper, or RCW, is the magic piece of code that enables interaction to occur between .NET and COM. For this example, select the COM tab and locate the component that you want to add to your .NET project. The name of...

Professional ASP.NET 3.5 in C# and Visual Basic Part 136

tailieu.vn

In fact, it became a very big contributor to DLL hell and the main reason why Microsoft began promoting the practice of installing private .NET component assemblies.. MyApp.exe. YourApp.exe. Figure 28-11. You can also add items to the GAC from the command line using the Global Assembly Cache Tool (Gacu- til.exe). It enables you to view and manipulate the contents...

Professional ASP.NET 3.5 in C# and Visual Basic Part 137

tailieu.vn

This scenario involves installing the .NET component into the Global Assembly Cache (GAC).. As with private assemblies, the .NET component and the consuming unmanaged code are the only requirements for deployment — besides the need to register the interop assembly using. When .NET was introduced, there was some initial concern about existing ActiveX controls and their place in Microsoft’s vision...

Professional ASP.NET 3.5 in C# and Visual Basic Part 138

tailieu.vn

Description : Applies a text description to the WebMethod that appears on the .aspx test page of the XML Web service.. MessageName : Applies a unique name to the WebMethod . If the WebMethod is the root object that initiated the transaction, the Web service can participate in a transaction with another WebMethod that requires a transaction. The XML Web...

Professional ASP.NET 3.5 in C# and Visual Basic Part 139

tailieu.vn

Now turn your attention to working with the Addition Web service using HTTP-GET. To accomplish this task, you must enable HTTP-GET from within the Web service application because it is disabled by default.. HTTP-GET requests have been disabled by default since ASP.NET 1.1. ASP.NET 1.0 did allow for HTTP-GET and even ran the Web service test interface page using it.....