将端点(特定IP)绑定到MSXML请求?

时间:2012-04-30 14:10:50

标签: c#-4.0 webdav msxml endpoint xmlhttprequest

您好,我将IPEndpoint绑定到我的WebRequests,如下所示

 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 Request做同样的事情。 这是我的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;

任何建议都将不胜感激。

1 个答案:

答案 0 :(得分:0)

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