Du,
The second URL returns a page with a redirect of some sort (http header or
javascript) that causes Internet Explorer to download the file. It's not a
direct link to the file. The reason it's like this is that the creators of
the website wanted to prevent people like you from automated downloading
like you're trying to do. If you decide not to respect their wishes, then
there's certainly a way to get the file anyway. It's possible that the
server is rejecting the request from your code to download the second link
because of the information sent in the HTTP header. Specifically, the
themexp server could be checking which client you're using to make sure it's
a browser. You'll have to spoof the header of the request sent using
WebClient somehow. I don't know if that's easily possible or not. You may
have to use a different library to send the web request, or do it yourself
using sockets. But it's a direction for you.
Chris
"Du Dang" <he**********@rogers.com.BAM> wrote in message
news:_r****************@news04.bloor.is.net.cable. rogers.com...
i wanna create a bot to download wallpaper from a website
cuz there are thousands of pic availiable and right click and "save as"
ain't fun no more
so far i got this from google
+++++++++++
WebClient Client = new WebClient();
Client.DownloadFile(url, save_as);
+++++++++++
but that code can only download static url only
ie. http://www.google.ca/intl/en_ca/images/logo.gif
but it doesn't work for links like
http://www.themexp.org/download.php?type=wp&id=96
it keep giving me http 400 error (bad request)
any help is appreciated
thanks
Du