了解 zend2 的工作原理,您可以像这样填充 url:
http://zend2.com/bro.php?u=http%3A%2F%2Fwww.google.com&b=12&f=norefer
用于浏览谷歌。
IC#,像这样构建 url:
string targetUrl = "http://www.google.com";
string proxyUrlFormat = "http://zend2.com/bro.php?u={0}&b=12&f=norefer";
string actualUrl = string.Format(proxyUrlFormat, HttpUtility.UrlEncode(targetUrl));
// Do something with the proxy-ed url
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(new Uri(actualUrl));
HttpWebResponse resp = req.GetResponse();
string content = null;
using(StreamReader sr = new StreamReader(resp.GetResponseStream()))
{
content = sr.ReadToEnd();
}
Console.WriteLine(content);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9224 次 |
| 最近记录: |