但是那边的网管已经通过我也不清楚的设定让机器能正常通过IE访问这个地址了.  they add a gateway ?

解决方案 »

  1.   

    try this code :public static void getPage(string url, string proxy) {
            try {
                WebProxy proxyObject = new WebProxy(proxy, 80);
     
                // 当主机为本地时,禁用代理,即不使用句点。
                proxyObject.BypassProxyOnLocal = true;
     
                // 实际上现在新的设置接管了全局,所有新的
                // 请求都使用此代理信息
                GlobalProxySelection.Select = proxyObject;
     
                WebRequest req = WebRequest.Create(url);
                WebResponse result = req.GetResponse();
                Stream ReceiveStream = result.GetResponseStream();
                Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
                StreamReader sr = new StreamReader( ReceiveStream, encode );
                Console.WriteLine("\r\n已接收到响应流");
                if (bShow) {
                    Char[] read = new Char[256];
                    int count = sr.Read( read, 0, 256 );
     
                    Console.WriteLine("HTML...\r\n");
                    while (count > 0) {
                        String str = new String(read, 0, count);
                        Console.Write(str);
                        count = sr.Read(read, 0, 256);
                    }
                    Console.WriteLine("");
                }
            } catch(Exception) {
                Console.WriteLine("\r\n找不到请求 URI,或者它的格式不正确");
            }
      

  2.   

    It's caused by firwall ,  you  must pass data by a Proxy
      

  3.   

    也就是说;我必须让他们找一个代理服务器?然后我们通过代理服务器来访问我的地址?
    try
    {
     WebProxy proxyObject = new WebProxy(proxy, 80);
     proxyObject.BypassProxyOnLocal = true;
    GlobalProxySelection.Select = proxyObject;
    ...}