[英]How To Get The Redirected URL From Original URL Visual Basic .NET
例如:
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? 请帮忙。 (我用谷歌搜索但没有找到任何解决方案)
项目信息:
谢谢你的时间。 编辑:
我只有一个URL为URL_1,我希望在URL1的帮助下获取URL_2。
请参阅下面的图片,一个着名的软件如何获取URL_2(100%未知的字符串)从URL_1(这是短URL和已知)立即。 我想在visual basic .net中的程序中做同样的事情。
我的问题现在已经解决了,感谢谷歌和Daniweb这里是解决方案
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。
为什么不将原始URL作为查询字符串参数传递? 即在url_1中,重定向到: http://pastehtml.com/view/b95qx66rc.html?redirectfrom=http://goo.gl/ouCeb
://pastehtml.com/view/b95qx66rc.html?redirectfrom: http://pastehtml.com/view/b95qx66rc.html?redirectfrom=http://goo.gl/ouCeb
://goo.gl/ouCeb
然后在url_2中使用此代码:
Dim OriginalURL As String = request.querystring("redirectfrom")
URL_2 =“http://”&URL_1&“/ view / b95qx66rc.html”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.