前些天有个要求要从某个网站上取信息,但是该网站要求用post方式访问的.现在这里贴两个google到的方法.
using System.Net;
static string WebClinetPost(string url, string postData,string encodeType,out string err)
{
string uriString = url;
byte[] byteArray;
byte[] responseArray;
//postData = "checkvalue=32&bbb=%CD%B6%C6%B1&ilc=0&kkk=22";
Encoding encoding = Encoding.GetEncoding(encodeType);
try
{
WebClient myWebClient = new WebClient();
WebHeaderCollection myWebHeaderCollection;
...[ 查看全文 ]