2008. 10. 31. 17:09
public ICredentials Credentials { get; set; }
public static void Main()
{
try {
WebClient client = new WebClient();
client.Credentials = CredentialCache.DefaultCredentials;
Byte[] pageData = client.DownloadData("http://www.contoso.com");
string pageHtml = Encoding.ASCII.GetString(pageData);
Console.WriteLine(pageHtml);
} catch (WebException webEx) {
Console.Write(webEx.ToString());
}
}