Mọi người cho mình hỏi: Mình có link a redirect sang link b -> c -> d -> e -> f
Làm sao trong c# mình có thể get toàn bộ link đó?
Làm sao trong c# mình có thể get toàn bộ link đó?
Bằng cách đăng ký với chúng tôi, bạn sẽ có thể thảo luận, chia sẻ và nhắn tin riêng tư với các thành viên khác trong cộng đồng của chúng tôi.
Đăng ký ngay!c# dùng system.net thôi @@ cho url chạy xong grab là điều đương nhiên rồi nhưng mà xong rồi :v sau 1 hồi mày mò cũng okÝ tưởng:
Tạo request là URL đến trang sau, sau đó grab toàn bộ những url trên đó
Redirect Detective - Discover where those redirects really go to
redirectdetective.comDOC thêm về dùng CURL trong linux: https://serverfault.com/questions/659940/http-url-redirection-command-line-traceTiny URL Expander | Redirect Checker - WhereGoes
Where does this link go? Check a link with our tiny URL expander! It's also a great redirect checker! Know where you are going with WhereGoes.wheregoes.com
string url = textBox1.Text;
StringBuilder sb = new StringBuilder();
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
while (!string.IsNullOrWhiteSpace(url))
{
sb.AppendLine(url);
System.Net.HttpWebRequest request = HttpWebRequest.CreateHttp(url);
request.AllowAutoRedirect = false;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
url = response.GetResponseHeader("Location");
}
}
MessageBox.Show( sb.ToString());
We get it, advertisements are annoying!
Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.