Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.net Equivalent of MSXML2.XMLHTTP40

Status
Not open for further replies.

ITking2009

Programmer
Aug 4, 2009
23
US
I am working on converting a VB6 app into C# app.
Here what i need to do

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 <> 4
DoEvents
TimeOut = DateDiff("s", dtStart, Now)
If TimeOut >= WaitTime Then 'Wait
Exit Do
End If
Loop
End function

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

"XMLHttpRequest.Open "GET", g_SonyFeedURL, True, sUsername, sPassword "

and DoEvents so that i can make it wait for couple of min and if i dont get a reponse abort the request?

Any suggestions?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top