Sunday, June 1, 2008

A simple way to get a content from an URL over the internet

sometimes we want to get the content over the internet and process the content, here is a super simple method that i discovered.

using System.Net;
using System.IO;

public static string GetWebContentString(string
HttpWebRequest httpReq =
HttpWebResponse httpRes =
Stream fs =
StreamReader sr = new
return sr.ReadToEnd();

No comments: