using System.Net; using System.Collections.Specialized; ... WebClient wc = new WebClient(); NetworkCredential nc = new NetworkCredential("usr", "mypassword"); wc.Credentials = nc; byte[] response = wc.DownloadData("http://localhost/testlogin"); Console.WriteLine(Encoding.ASCII.GetString(response));