WebClient 403 Forbidden

后端 未结 8 1625
失恋的感觉
失恋的感觉 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 10:43

    I had this problem trying to download an image from a SharePoint site url. In my case setting the user-agent to Other or blank in the header wasn't enough, I had to set the user-agent as follows instead:

    client.Headers.Add("user-agent", " Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0");
    

    That solution came from this answer.

提交回复
热议问题