WebClient wc_DoLogin = new WebClient();
wc_DoLogin.UploadStringCompleted += new
UploadStringCompletedEventHandler(wc_DoLogin_UploadStringCompleted );
wc_DoLogin.Headers["content-type"]
= "application/x-www-form-urlencoded";
wc_DoLogin.UploadStringAsync(
new Uri(Url, UriKind.Absolute),
"POST" ,
"欄位1=欄位值&欄位2=欄位值2");
Server回應將會在
void wc_DoLogin_UploadStringCompleted
(object sender, UploadStringCompletedEventArgs e)
{
MessageBox.Show("result is : " + e.Result);
}
沒有留言:
張貼留言