c# - Downloading a file from a redirection page -
how go downloading file redirection page (which calculations based on user).
for example, if wanted user download game, use webclient , like:
client.downloadfile("http://game-side.com/downloadfetch/");
it's not simple doing
client.downloadfile("http://game-side.com/download.exe");
but if user click on first one, redirect , download it.
i think, should go customized webclient
class that. follow code 300 redirects:
public class mywebclient : webclient { protected override webresponse getwebresponse(webrequest request) { (request httpwebrequest).allowautoredirect = true; webresponse response = base.getwebresponse(request); return response; } } ... webclient client=new mywebclient(); client.downloadfile("http://game-side.com/downloadfetch/", "download.zip");
Comments
Post a Comment