using (var webClient = new WebClient())
{
webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
var result = webClient.UploadString("https://your-url.com", string.Format("username={0}password={1}", "usernamegoeshere", "paswordgoeshere"));
}
1 回答
这是一个非常简单的例子 . 我希望这是你需要的: