How can i get xml files from a web site and save it on pc. what is easy way with C# ?
+5
A:
Use WebClient from the .NET library:
WebClient Client = new WebClient();
Client.DownloadFile("http://foo.bar", @"C:\filename.xml");
csl
2009-10-08 11:34:58
i tried it but the server get error 404. But i can open the xml with the browser. The address is http://www.eshot.gov.tr/OtobusHareket/Hatlar/86_donus.xml
drorhan
2009-10-08 12:06:08
@drorhan: That means you have probably used an incorrect URL. Are you using the internet through a proxy? That may also make a difference. See here for HTTP error codes: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
csl
2009-10-08 12:34:10
no i do not use a proxy. i can open the page from firefox or ie. But the code gives me 404.
drorhan
2009-10-08 12:56:42
The problem has solved. i guess the problem was from the server. thanks
drorhan
2009-10-08 14:09:58