Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting ASP(VB) to ASP.NET(C#)
Message
General information
Forum:
ASP.NET
Category:
XML
Miscellaneous
Thread ID:
00734381
Message ID:
00734404
Views:
20
Look at the webrequest class.
using System.Net;
using System.IO;
using System.Xml;
...
...
// Get a handle on the remote ressource
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://p.moreover.com/cgi-local/page?c=Web%20developer%20news&o=rss");
// Read the response
WebResponse resp = wr.GetResponse();
// Stream read the response
Stream stream = resp.GetResponseStream();
// Read XML data from the stream
XmlTextReader reader = new XmlTextReader(stream);
// ignore the DTD
reader.XmlResolver = null;
// Create a new document object
XmlDocument doc = new XmlDocument();
// Create the content of the XML Document from the XML data stream
doc.Load(reader);
Response.Write(doc.OuterXml);
>Hi All,
>
>I Have a XML function in ASP(VB) that I was hoping someone could offer assistance in converting it to ASP.NET(C#)
>
>< % ERROR: 
>Response.Buffer = True
>Dim objXMLHTTP, xml
>
>Set xml = Server.CreateObject("Microsoft.XMLHTTP")
>xml.Open "GET", "http://www.domain.com/", False
>	
>xml.Send
>
>Response.Write "<h1>The HTML text</h1><xmp>"
>Response.Write xml.responseText
>Response.Write "</xmp><p><hr><p><h1>The HTML Output</h1>"
>Response.Write xml.responseText
>
>Set xml = Nothing
> % >
>
>Any Help is Appreciated.
>
>Kind Regards,
>Tarran Walker
>tarran.walker@milkit.net
Previous
Reply
Map
View

Click here to load this message in the networking platform