473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 14851
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dan Sikorsky | last post by:
Uploading from browser to server using Msxml2.XMLHTTP takes a long time about 15 minutes for a 1.5MB file at 37.2Kbps, although it does get there. Is there anyway to speed things up? here's the...
1
by: Eric | last post by:
I have a form with an INPUT type=file in it. I have another button that calls a function to exercise the oHTTP below. I think I need to open with the path of the CGI script on the server. What...
5
by: RK | last post by:
I am getting the "HTTP /1.1 405 - method not allowed" error when I am sending XML string over Msxml2.XMLHTTP object. I am sending data in POST, also passing querystring variable and here is the...
4
by: rlr1031 | last post by:
I'm working on a project where we have to call up a URL from a Java servlet - the only sample call we have is some Javascript that used an MSXML2.XMLHTTP object to send the request, using a...
3
by: BjörnHolmberg | last post by:
I'm trying to consume a WS from Excel (Office 98), seems that I can't send arguments into the WS. In order to pinpoint the problem I've written the following application i C# and VB6. It reproduces...
1
by: Mike | last post by:
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 =...
5
by: Brent | last post by:
This AJAX stuff is all new to me. To try it out, I borrowed this code from a website: ======================== var http_request = false; function makeRequest(url) { http_request = false;
2
by: noOby | last post by:
Hi developers, currently i'm doing a school project and i am stuck on MSXML2.XMLHTTP conversion from vb code to c#. Below is the vb Coding that i need to convert to C# Dim sUrl As String ...
2
by: Dave | last post by:
I am running the following code and I get an error: Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0") xmlHttp.Open "Get", URLToRSS, false xmlHttp.Send RSSXML = xmlHttp.ResponseText The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.