This solution demonstrates how to send and receive data using HTTP and streams using the System.Net classes.
The form contains four Button controls, two TextBox controls, and one PictureBox control. The first three buttons show how to send and receive data from a file. The last button shows how to send text back and forth to the web application. When using the fourth button, the text in the editable text box is sent to the web server, and the returned text is displayed in the read-only text box. Additionally, there is a virtual directory named SendAndReceiveDataWebPages that receives and returns data.
File I/O is performed in and out of the files using FileStreams. Network I/O is performed between client and server using Request and Response streams.
Requires the Trial or Release version of Visual Studio .NET Professional (or
greater) 2003.
Also requires a version of Windows that supports ASP.NET.
The application communicates with a set of ASP.NET files that are served up by IIS. The Setup.vbs file copies these files from a subdirectory of the sample to a subdirectory of the default Web site.