WebClient 403 Forbidden

后端 未结 8 1636
失恋的感觉
失恋的感觉 2020-12-17 10:30

I can download this by hand in IE.

http://scholar.google.com/scholar.ris?q=info:j8ymU9rzMsEJ:scholar.google.com/&output=citation&hl=zh-CN&as_sdt=2000&

8条回答
  •  清歌不尽
    2020-12-17 11:07

    Just add a simple line before you make your download:

    string url = ... 
    string fileName = ...
    
    WebClient wb = new WebClient();
    wb.Headers.Add("User-Agent: Other");   //that is the simple line!
    wb.DownloadFile(url, fileName);
    

    That's it.

提交回复
热议问题