/author: duncan mackenzie
using system;
using system.net;
using system.io;
namespace makeagetrequest_charp
{
/// <summary>
/// summary description for class1.
/// </summary>
class class1
{
static void main(string[] args)
{
string surl;
surl = "http://www.microsoft.com";
webrequest wrgeturl;
wrgeturl = webrequest.create(surl);
webproxy myproxy = new webproxy("myproxy",80);
myproxy.bypassproxyonlocal = true;
wrgeturl.proxy = webproxy.getdefaultproxy();
stream objstream;
objstream = wrgeturl.getresponse().getresponsestream();
streamreader objreader = new streamreader(objstream);
string sline = "";
int i = 0;
while (sline!=null)
{
i++;
sline = objreader.readline();
if (sline!=null)
console.writeline("{0}:{1}",i,sline);
}
console.readline();
}
}
}
