有這么一批百度云私密鏈接需要監控,定時查看是否掛擋了,請求的時候有個問題,百度云私密鏈接,比如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 回答
- 0 關注
- 742 瀏覽
添加回答
舉報
0/150
提交
取消