title: .net Equivalent of MSXML2.XMLHTTP40
body: <p>I am working on converting a VB6 app into C# app.
  Here what i need to do</p>
  
  <pre><code>Public Function SendData(sUsername as string ,sPassword as string, url as string , message as string ) As Boolean
  
  Dim XMLHttpRequest   As MSXML2.XMLHTTP40
  Set XMLHttpRequest = New MSXML2.XMLHTTP40
  
  XMLHttpRequest.Open "GET", g_SonyFeedURL, True, sUsername, sPassword   
  XMLHttpRequest.setRequestHeader "Synchronous", "False"
  XMLHttpRequest.setRequestHeader "Content-Type", "text/xml"
  XMLHttpRequest.setRequestHeader "Accept-Language", "en-US"
  dtStart = Now
  XMLHttpRequest.send
  Do While XMLHttpRequest.ReadyState &lt;&gt; 4
              DoEvents            
              TimeOut = DateDiff("s", dtStart, Now)
              If TimeOut &gt;= WaitTime Then 'Wait
                Exit Do
              End If
          Loop
  End function
  </code></pre>
  
  <p>Now i understand i can do the above using httpwebrequest but not able to figure how to send the username and password or in other words what would be c# equivalent of</p>
  
  <p>"XMLHttpRequest.Open "GET", g_SonyFeedURL, True, sUsername, sPassword   "</p>
  
  <p>and DoEvents so that i can make it wait for couple of min and if i dont get a reponse abort the request?</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks.</p>