이해를 WebProxy Class
MSDN 코드
WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true);
WebRequest req = WebRequest.Create("http://www.contoso.com");
req.Proxy = proxyObject;
을 사용할 수 있습니다,이 같은 URL을 채울 수 있습니다 :
를
http://zend2.com/bro.php?u=http%3A%2F%2Fwww.google.com&b=12&f=norefer 브라우징 구글에 대한
6,. 당신은`WebProxy`을 사용할 수 있습니다 알고
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);
:
I C#을,이 같은 URL을 구축 할 수 있습니다. 그것이 해결책입니다. 너 무슨 짓을 한거야? "웹 사이트 연결"이란 무엇을 의미합니까? 브라우저를 사용하고 있습니까? C#을 사용하여 webrequest? –
예 제목에서 프로그래밍 방식으로이 작업을 수행 할 수 있음을 읽을 수 있습니다 (C#을 사용) – Ozkan
프로그래밍 방식으로 무엇을 할 수 있습니까? 두 가설은 프로그래밍 방식으로 수행 할 수 있습니다. –