为了账号安全,请及时绑定邮箱和手机立即绑定

制作监控百度云私密链接时的疑惑

制作监控百度云私密链接时的疑惑

C#
皈依舞 2018-07-28 12:10:43
有这么一批百度云私密链接需要监控,定时查看是否挂挡了,请求的时候有个问题,百度云私密链接,比如http://pan.baidu.com/s/1o7QhUps,它在请求过程中还会进行302跳转,跳转到http://pan.baidu.com/share/init?shareid=3900055188&uk=1100738292,因此我写了这么个程序 HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://pan.baidu.com/s/1o7QhUps/");             req.Method = "Get";             req.Accept = "text/html";                          HttpWebResponse myResp = (HttpWebResponse)req.GetResponse();            if (myResp.StatusCode == HttpStatusCode.Redirect)             { Console.WriteLine("redirected to:" + myResp.GetResponseHeader("Location")); }现在问题就是在请求如http://pan.baidu.com/s/1o7QhUps 这种类型的链接后,直接返回远程服务器返回错误: (403) 已禁止,而访问http://pan.baidu.com/share/init?shareid=3900055188&uk=1100738292这种就没事
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 674 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信