我如何阅读ASP.NET 2.0中的HttpResponse?

Dav*_*vid 3 c# asp.net httpresponse

例如,我有一个由另一个aspx调用的ASP.NET表单:

string url = "http://somewhere.com?P1=" + Request["param"];
Response.Write(url);
Run Code Online (Sandbox Code Playgroud)

我想做这样的事情:

string url = "http://somewhere.com?P1=" + Request["param"];
string str = GetResponse(url);
if (str...) {}
Run Code Online (Sandbox Code Playgroud)

我需要得到任何Response.Write得到的结果或者去url,操纵那个响应,然后发回别的东西.

任何帮助或正确方向的一点将不胜感激.

Joh*_*han 8

WebClient client = new WebClient();
string response = client.DownloadString(url);
Run Code Online (Sandbox Code Playgroud)