블로그 이미지
Sunny's

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

'WebClient'에 해당되는 글 1

  1. 2009.10.14 WebClient UploadData
2009. 10. 14. 15:01 .NET Framework
WebClient UploadData


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

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

      NameValueCollection nvc = new NameValueCollection();

      nvc.Add("lastname""Blum");
      nvc.Add("firstname""Rich");

      byte[] response = wc.UploadValues(uri, nvc);
      Console.WriteLine(Encoding.ASCII.GetString(response));
   }
}
posted by Sunny's
prev 1 next