By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,440 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,440 IT Pros & Developers. It's quick & easy.

HttpWebRequest

P: n/a
RCK
Hi All

Can anyone know how to convert following ASP statement into .NET commands? I want to know what class in .NET is equivalent to the XMLHTTP.open command. Thanx

fileName = request("fileName"
Set xDom = Server.CreateObject("Microsoft.XMLDOM"
xDom.async = FALS
Set xh = Server.CreateObject("Microsoft.XMLHTTP"
xh.open "POST", "htttp://www.abc.com/xmreurn.aspx", FALS
xDom.Load fileNam
xh.Send xDom.XM
rtn = xh.Responsetex
Set xh = Nothin
Response.Write(rtn

RC
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello RCK,

Try this:

string filename = Request.QueryString["fileName"];
XmlDocument xDom = new XmlDocument();
xDom.Load(filename);

System.Net.WebClient wc = new System.Net.WebClient();
byte[] response = wc.UploadData("http://www.abc.com/xmreurn.aspx",
"POST",
Encoding.UTF8.GetBytes(xDom.InnerXml));
Response.Write(Encoding.UTF8.GetString(response));
fileName = request("fileName")
Set xDom = Server.CreateObject("Microsoft.XMLDOM")
xDom.async = FALSE
Set xh = Server.CreateObject("Microsoft.XMLHTTP")
xh.open "POST", "htttp://www.abc.com/xmreurn.aspx", FALSE
xDom.Load fileName
xh.Send xDom.XML
rtn = xh.Responsetext
Set xh = Nothing
Response.Write(rtn)


--
Matt Berther
http://www.mattberther.com
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.