Upload Values : WebClient : Network C# Examples


C# Examples » Network » WebClient »

 

Upload Values









    
using  System;
using  System.Collections.Specialized;
using  System.Net;
using  System.Text;

class  MainClass
{
      public  static  void  Main(string[]  argv)
      {
            WebClient  wc  =  new  WebClient();
            string  uri  =  "http://localhost/testform.aspx";

            NameValueCollection  nvc  =  new  NameValueCollection();

            nvc.Add("lastname",  "B");
            nvc.Add("firstname",  "A");

            byte[]  response  =  wc.UploadValues(uri,  nvc);
            Console.WriteLine(Encoding.ASCII.GetString(response));
      }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» WebClient