0

我确实尝试过像我在网页上所做的那样。我的意思是,在网页上,我单击按钮,发布事件从 ASP 页面请求我的查询结果。

在这里,我确实以编程方式尝试它;

string paramaters = "sql=select+%2A+from+hsp%5Fistanbul+u+where+u%2Ehsp%5Fhosdere%5Fno+%3D+28960099";
    string strResponse;

HttpWebRequest requestLogin = (HttpWebRequest)WebRequest.Create("http://10.1.20.39/query/query.asp");
requestLogin.Credentials = new NetworkCredential("xyz", "tyewrrf"); 
requestLogin.Method = "POST"; 
 requestLogin.ContentType = "application/x-www-form-urlencoded"; 
requestLogin.ContentLength = paramaters.Length; 
StreamWriter stOut = new StreamWriter(requestLogin.GetRequestStream(), System.Text.Encoding.ASCII);
stOut.Write(paramaters); 
stOut.Close();
HttpWebResponse responseLogin = (HttpWebResponse)requestLogin.GetResponse(); 
StreamReader stIn = new StreamReader(responseLogin.GetResponseStream());
strResponse = stIn.ReadToEnd();// here I want to get the the same html codes as if I do click on the web page...
stIn.Close();  
4

2 回答 2

1

考虑使用http://watin.org/吗?

于 2012-05-15T10:12:52.313 回答
0

参数不好,这就是为什么我使用萤火虫查看帖子数据的原因。然后它开始工作了。

于 2012-05-28T11:21:10.013 回答