Well, you would want to use the HttpWebRequest/HttpWebResponse classes
to get the contents of the site. Once you do that, you can get the response
stream from the HttpWebResponse to feed the XmlDocument class to load the
document.
Once you have that, it's a simple matter of using the classes in
System.Data.? (where ? is specific for your database) to insert the data.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Dhananjay" <dhanan...@yahoo.co.in> wrote in message
news:1165499910.8...@f1g2000cwa.googlegroups.com...
hi Nicholas Paldino
i ahve passed this
public void page_load()
{
Uri uri = new Uri("http://de.wikipedia.org/wiki/indien");
if (uri.Scheme == Uri.UriSchemeHttp)
{
HttpWebRequest req =
(HttpWebRequest)HttpWebRequest.Create(uri);
req.Method = WebRequestMethods.Http.Get;
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
StreamReader sr = new
StreamReader(res.GetResponseStream());
string tmp = sr.ReadToEnd();
res.Close();
this.txturl.Text = tmp;
}
}
but i have got error it is not opening this url. i have got problem in
webresponse it is showing null can u coorect and plz send me.
reply me asap
its urgent
Thanks
Dhananjay
However in 2.0 a better solution may be to use WebClient:
string html;
using (WebClient client = new WebClient()) {
html =
client.DownloadString(@"http://de.wikipedia.org/wiki/indien/");
}
this.txturl.Text = html;
Marc
hi marc
i have tried this code also which is provied by you but i have got
error
the error is
The remote server returned an error: (403) Forbidden. what sould i do
do you have any other solution let me know plz
its urgent Thanks Dhananjay
string html;
> using (WebClient client = new WebClient()) {
> html =
> client.DownloadString(@"http://de.wikipedia.org/wiki/indien/");
> }
> this.txturl.Text = html;
Thanks
Dhananjay
Following works for me; I have tested it properly this time!
html = client.DownloadString(@"http://de.wikipedia.org/wiki/Indien");
Marc