How Web Forms Work
Web Forms live in the same realm as the HTML page. When you create an ASP.NET Web Form, you make it available for use by placing it within the directory structure of an IIS Web server. It's important to note that only an ASP.NET-aware Web server, such as IIS 5 running on Windows 2000, is capable of processing and serving ASP.NET applications. This is because, unlike HTML Web pages, an ASP.NET Web Form must be processed before the results can be sent to the requesting browser. You can think of...
Calling XML Web Services
You can call upon XML Web services from within your Windows application, Web application, and class Library projects. Formulating SOAP requests, communicating with remote Web servers using HTTP, and unpackaging the SOAP formatted results might sound like a daunting task, but if you are using Visual Studio .NET to create your projects, it's as simple as can be. All you need to do is to add a reference for a particular remote XML Web service to your project, and then use it like you would any...
Writing an XML Document Using XmlTextWriter
The XmlTextWriter class provides you with a toolkit for writing XML in its serialized form, complete with angle brackets, processing instructions, and all the other elements you see in XML documents. This class lets you concentrate on the logical structure of your XML, and frees you from having to worry about the formatting. Here's a simple program showing how XmlTextWriter can be used to construct a simple XML document ' Import the namespace so we can use all the XML stuff. Imports System.Xml...
TextWriter Classes
TextWriter is an abstract base class that has a number of subclasses HtmlTextWriter for writing HTML to browser clients HttpWriter for writing text to the HTTP response object in ASP.NET pages IndentedTextWriter for writing text with indentation control StreamWriter for writing characters to a stream StringWriter for writing characters to a string For C programmers, StreamWriter is analogous to printf or fprintf , and StringWriter is analogous to sprintf . TextWriter has three properties...
Creating a Print Handler
The actual printing process is carried out on behalf of the PrintDocument by a PrintController object. If you don't create another PrintController yourself, the PrintDocument will work with a StandardPrintController that is suitable for default output to most printers. If you want to manually specify print preview, you can create a PreviewPrintController object that handles printing to print preview windows. PrintController classes have four methods StartPrint Called at the start of the job...
Finding and Choosing a Printer
The InstalledPrinters property of the PrinterSettings class returns a list of strings containing the names of all installed printers. The following code fragment shows how to use this property to print out a list of all the printers installed on the system Sub Main ' Create a PrinterSettings object Dim ps As New PrinterSettings ' Get the list of installed printers Dim en As IEnumerator ps.InstalledPrinters.GetEnumerator ' Print out all the printer names While en.MoveNext True Console.WriteLine...
Setting Security Policies
In .NET Beta 2 there is no GUI tool, and all policy manipulation is done using the caspol.exe command-line tool. Caspol can be used to edit enterprise-, machine-, and user-level policies using the appropriate switches. The tool is simply run from a command window by giving the command name followed by one or more options A large number of flags can be used with caspol, and Table 7.4 lists some of the most commonly used options. Note that most of the options have one- or two-letter...
Creating the DataSef s Schema
Although there are many ways to create a DataSet schema, there are two smart ways I want to show you to help you get the job done quickly. The first method involves using an already loaded DataSet. If you have a DataSet loaded with the proper data elements and relationships, all you need to do to create a schema to lock-in this DataSet's format is to use the WriteXmlSchema method like this Dim XMLOut As IO.FileStream New IO.FileMode.OpenOrCreate, IO.FileAccess.Write dsCompany.WriteXmlSchema...
Using the Http Channel to Call Remote Objects
So far in my examples I have used the Tcp channel to create a client and a server object. You can opt to use the Http channel in place of the Tcp channel. Although not as efficient as Tcp, the Http channel uses SOAP to wrap its Remoting messages, which makes your messages universally understandable. Http can also pass through common Internet ports, such as port 80, which allows this protocol to pass through most firewalls unabated. As mentioned earlier, there are two ways to configure your...
Creating a Web Form
Although Web Forms can be created using any of the Visual Studio .NET development languages, you can only add Web Forms to two of the .NET project types the ASP.NET Web Application and the ASP.NET XML Web Service. This restriction to Web Form usage is due to the fact that a Web server is required to process these pages, and non-Web project types do not interface with the Web server. You will not be able to add Web Forms to projects such as the class Library and Windows application projects. The...
Handling a Change oi Drive
Because the user is going to use the ComboBox to select a drive letter, you need to handle this selection process. The ComboBox raises a SelectedIndexChanged event when someone chooses an item, so you need to add a handler for this event to the Form class. In the Visual Studio Designer, you can do this by double-clicking on the ComboBox object Protected Sub ComboBox1_SelectedIndexChanged ByVal sender _ As System.Object, ByVal e As System.EventArgs _ Handles ComboBox1.SelectedIndexChanged If...
Heres C
Where has C come from You can trace its origins back to two facts. It's no secret that Visual J met a rather untimely end, killed off by the bumpy relationship between Microsoft and Sun. Microsoft recognized that Visual J had two unique qualities The first of which was that Java was a simpler language for OO programmers to use than C , and the second was that it was very easy to write COM components in Visual J . C can be a very hard language to use well, so much so that it is overkill for a...
