2012-04-30 100 views
0

您好我做IPEndpoint結合我WebRequests如下將端點(特定IP)綁定到MSXML請求?

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; 

任何建議將不勝感激。

回答

0

我意識到我們不能讓端點與MSXML綁定

相關問題