如何从原始 URL Visual Basic .NET 获取重定向的 URL [英] How To Get The Redirected URL From Original URL Visual Basic .NET

查看:47
本文介绍了如何从原始 URL Visual Basic .NET 获取重定向的 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如:

    URL_1 (Short URL) = "http://af.ly/FQhAo"

这将重定向到

    URL_2 (Original URL) = "http://download.bitdefender.com/windows/desktop/t_security/2013/en-us/bitdefender_ts_2013_32b.exe"

那么我们如何从 URL_1 获取 URL_2?请帮助.(我用谷歌搜索但没有找到任何解决方案)

So how can we get URL_2 From URL_1? help Please. (I have googled but not found any solution)

项目信息:

  • 平台:Visual Basic Express 2010
  • .NET 框架版本:2.0

感谢您的光临.

我只有一个 URL,它是 URL_1,我想在 URL1 的帮助下获取 URL_2.

I just have one URL which is URL_1, and I want to get the URL_2 with the help of URL1.

参见下图,著名软件如何从 URL_1(短 URL 和已知)立即获取 URL_2(100% 未知字符串).我想在visual basic .net的程序中做同样的事情.

See The Image below, How a famous Software getting URL_2 (which is 100% unknown string) From URL_1 (which is short URL and Known) instantly. I want to do same in my program in visual basic .net.

推荐答案

我的问题现在解决了,感谢 google 和 Daniweb这是解决方案

My Problem is now solved, thanks to google and Daniweb here is solution

Dim req As HttpWebRequest = DirectCast(HttpWebRequest.Create("Your short URL here"), HttpWebRequest)
        Dim response As HttpWebResponse
        Dim resUri As String
        response = req.GetResponse
        resUri = response.ResponseUri.AbsoluteUri
        MsgBox(resUri)

这将返回 URL_2.

this will return URL_2.

这篇关于如何从原始 URL Visual Basic .NET 获取重定向的 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆