首页 > Web开发 > 详细

wp8 入门到精通 WebClient Post

时间:2014-03-31 06:41:27      阅读:588      评论:0      收藏:0      [点我收藏+]

WebClient wc = new WebClient();

var URI = new Uri("http://your_uri_goes_here");

//If any encoding is needed.

wc.Headers["Content-Type"] = "application/x-www-form-urlencoded";

//Or any other encoding type.

//If any key needed

wc.Headers["KEY"] = "Your_Key_Goes_Here";

wc.UploadStringCompleted += new UploadStringCompletedEventHandler(wc_UploadStringCompleted);

wc.UploadStringAsync(URI, "POST", "Data_To_Be_sent");

 

void wc_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{

try
{
MessageBox.Show(e.Result);
//e.result fetches you the response against your POST request.

}

catch (Exception exc)
{
MessageBox.Show(exc.ToString());
}

}

wp8 入门到精通 WebClient Post,布布扣,bubuko.com

wp8 入门到精通 WebClient Post

原文:http://www.cnblogs.com/luquanmingren/p/3634953.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!