471,330 Members | 1,085 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

How to convert MSXML2.XMLHTTP.3.0 calls to .Net in C#

Currently I do the below in ASP server side code.
var xmlHttpReq = new ActiveXObject("MSXML2.XMLHTTP.3.0");
xmlHttpReq.open("GET", "HTTP://MYURL", false);
xmlHttpReq.send();
var returnValue = xmlHttpReq.responseText;

How can I duplicate this in .Net?

Thanks
Jul 21 '05 #1
1 14091
mike

You can try httpWebRequest & httpWebResponse

HttpWebRequest req = (HttpWebRequest)HttpWebRequest .Create(http://myurl) ;
HttpWebResponse resp = (HttpWebResponse)req.GetResponse() ;

StreamReader sr = new StreamReader(resp.GetResponseStream,Encoding.ASCII );

Console.WriteLine(sr.ReadToEnd())
sr.Close();

also see
http://msdn.microsoft.com/library/de...classtopic.asp

I did not test the actual code, but this might be what you are looking for

Henk

"Mike" <si***@newsgroups.nospam> wrote in message
news:7F**********************************@microsof t.com...
Currently I do the below in ASP server side code.
var xmlHttpReq = new ActiveXObject("MSXML2.XMLHTTP.3.0");
xmlHttpReq.open("GET", "HTTP://MYURL", false);
xmlHttpReq.send();
var returnValue = xmlHttpReq.responseText;

How can I duplicate this in .Net?

Thanks

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by BjörnHolmberg | last post: by
2 posts views Thread by noOby | last post: by
2 posts views Thread by Dave | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.