Programmatically posting data to a traditional ASP page is an extremely
useful and well-known technique. However, I recently discovered that posting
data to an ASP .NET Web application from another program is not well
understood and requires several new programming tricks. In this article I'll
show you how to use the HttpWebRequest class and the ASP .NET ViewState
mechanism to programmatically send form data to an ASP .NET Web application
and then capture the response. This will provide you with a powerful new way
to write utility programs for your Web applications. (Note: This article
assumes you are familiar with creating ASP .NET Web applications, using
classes in the .NET Framework, and have intermediate familiarity with the C#
language.)
The best way to demonstrate what we will accomplish is with two screenshots.
Figure 1 shows a simple ASP .NET Web applicatio... (more)
If you work in a .NET environment you have probably come across Base64
encoded data. For example, Base64 encoding is used in ASP.NET for a Web
application's ViewState value, as shown in Figure 1. Base64 encoding is also
used to transmit binary data over e-mail. However, if you are like most of my
colleagues (and me until recently) you do not have a thorough understanding
of precisely what Base64 encoding is and when Base64 encoding should be used.
In the this article I will explain exactly what Base64 encoding is, show you
how to use the two primary .NET Framework methods that su... (more)
Sooner or later you'll probably find it useful to be able to create and
manipulate combinations programmatically. By far the most useful kinds of
combinations are string combinations. A string combination of order (n, k) is
a subset of k strings chosen from a set of n strings, where order doesn't
matter. For example, suppose you have the strings {"ant", "bat", "cow",
"dog", "elk"}, so n = 5. If you set k = 3, there are 10 string combination
elements:
{"ant", "bat", "cow"}
{"ant", "bat", "dog"}
{"ant", "bat", "elk"}
{"ant", "cow", "dog"}
{"ant", "cow", "elk"}
{"ant", "dog", "elk"}
... (more)