Gets or sets the network credentials used for authenticating the request with the Internet resource.
using System; using System.Net; using System.IO; using System.Text; using System.Threading; public class MainClass{ public static void Main(){ WebRequest request = WebRequest.Create ("http://www.google.com"); request.Credentials = CredentialCache.DefaultCredentials; HttpWebResponse response = (HttpWebResponse)request.GetResponse (); } }