0

嗨,我将 IPEndpoint 绑定到我的 WebRequest,如下所示

 if (!ipAddress.Equals(myLocalIP))
            {
                request.ServicePoint.BindIPEndPointDelegate =
                   delegate(ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount)
                   {
                       return new IPEndPoint(IPAddress.Parse(ConfigurationManager.AppSettings["SS_Outbound_IP"]), 0);
                   };
            }

我需要对 MSXML 请求做同样的事情。这是我的 MSXML 请求。

 var xmlHttp_ = new XMLHTTP();
        Console.WriteLine("My IP is: "+FindMyPublicIPAddress());
        // Build the query.
        string requestString =
            "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" +
            "<a:propfind xmlns:a=\"DAV:\">" +
            "<a:prop>" +
            "<a:displayname/>" +
            "<a:iscollection/>" +
            "<a:getlastmodified/>" +
            "</a:prop>" +
                "</a:propfind>";

            // Open a connection to the server.
            xmlHttp_.open("PROPFIND", Uri, false, "UserName","Password");

            // Send the request.
            xmlHttp_.setRequestHeader("PROPFIND", requestString);
            xmlHttp_.send(null);


        // Get the response.
        string folderList = xmlHttp_.responseText;

任何建议将不胜感激。

4

1 回答 1

0

我意识到,我们无法使用 MSXML 进行端点绑定

于 2012-06-20T17:00:13.463 回答