Using WebClient in C# is there a way to get the URL of a site after being redirected?

后端 未结 8 1500
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 03:21

Using the WebClient class I can get the title of a website easily enough:

WebClient x = new WebClient();    
string source = x.DownloadString(s);
string titl         


        
8条回答
  •  独厮守ぢ
    2020-11-29 03:45

    The WebClient class has an option to follow redirects. Set that option and you should be fine.

提交回复
热议问题