using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

 

namespace getBaiDuUrl
{
class Program
{
static void Main(string[] args)
{
string LastAdurl= GetLocation("http://www.baidu.com/link?url=MW4aqBcVd9VSAsqrVcG8lMzlHUU1qWjFsD_PxZNEjJlxE1sNpirSITeWwcBgcGQ8");
}
public static string GetLocation(string URL)
{
HttpClientHandler hander = new HttpClientHandler();
hander.AllowAutoRedirect = false;
HttpClient client = new HttpClient(hander);
return client.GetAsync(URL).Result.Headers.Location.ToString();
}
}
}

 

相关文章:

  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
猜你喜欢
  • 2021-08-02
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案