NetworkCredential test : Web Client : Network C# Source Code


Custom Search

C# Source Code » Network » Web Client »

 

NetworkCredential test








    



using System;
using System.Net;
using System.Text;

public class CredTest
{
   public static void Main()
   {
      WebClient wc = new WebClient();

      NetworkCredential nc = new NetworkCredential("alex", "mypassword");

      wc.Credentials = nc;

      byte[] response = wc.DownloadData("http://www.navioo.com/index.htm");
      Console.WriteLine(Encoding.ASCII.GetString(response));
   }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» Web Client