protected string GetPage(string Url,string Parameter,string StartTxt,string EndTxt)
{
HttpWebRequest oRequest = (HttpWebRequest)WebRequest.Create(Url);
oRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
string strPost = Parameter; ;
byte[] somebyte = Encoding.Default.GetBytes(strPost);
oRequest.Method = "POST";
oRequest.ContentLength = somebyte.Length;
oRequest.ContentType = "application/x-www-form-urlencoded";
StreamWriter oStreamWriter = new StreamWriter(oRequest.GetRequestStream(), System.Text.Encoding.GetEncoding("GB2312"));
oStreamWriter.Write(strPost);
oStreamWriter.Close();
HttpWebResponse oResponse = (HttpWebResponse)oRequest.GetResponse();
StreamReader sr = new StreamReader(oResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312"));
string sResultContents = sr.ReadToEnd();
sr.Close();
oResponse.Close();
//截取所需要的部分
int start, stop;
start = sResultContents.IndexOf(StartTxt);
stop = sResultContents.IndexOf(EndTxt, start) + EndTxt.Length;
string temp = sResultContents.Substring(start, stop - start);
return temp;
}