GetResponse Sample

Sample Overview

This sample demonstrates the use of the WebRequest and WebResponse classes in the System.Net namespace by getting HTML pages from a URL that is input by the user and then outputting the URL to the console.  The sample illustrates the use of proxies with WebRequest instances as well as asynchronous input and output, and threading.

Sample Source and Build Output Locations

The sample source is found in sscli\samples\howto\net\getresponse. 

The source file is:

The build output location is %TARGETCOMPLUS%\samples\howto\net\getresponse. The output file is an executable assembly named getresponse.exe.

Building the Sample

All samples are built from the buildall script. 

You can also build all the samples by switching to the root of the sample directory, sscli\samples, and typing build -c.

You can build this specific sample by switching to the sample directory and typing build -c.

Running the Sample

These steps require that the Shared Source CLI (SSCLI) be already built and functional.

  1. Run env.bat or source the env.csh or env.sh script files depending on your platform.
  2. Switch to the %TARGETCOMPLUS%\samples\howto\net\getresponse directory.
  3. Type the following command:

    clix getresponse.exe


Copyright (c) 2002 Microsoft Corporation. All rights reserved.