【问题标题】:Bind endpoint(specific IP) to MSXML Request?将端点(特定 IP)绑定到 MSXML 请求?
【发布时间】:2012-04-30 14:10:49
【问题描述】:

您好,我将 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;

任何建议将不胜感激。

【问题讨论】:

    标签: c#-4.0 webdav msxml endpoint xmlhttprequest


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2011-04-15
      • 2012-09-17
      • 1970-01-01
      • 2013-02-05
      • 1970-01-01
      • 2012-04-16
      • 2017-03-11
      • 2012-05-23
      • 2012-05-26
      相关资源
      最近更新 更多