简体   繁体   中英

vb.net - how to get real link from php url

I have an example URL ( http://www.techspot.com/downloads.php?action=download_now&id=2991&evp=113a02f49ca8ac11b566336b984b1655&file=1 ). And when I click the link, the url will change to:

http://www.exisoftware.com/downloads/picture_finder/PictureFinderSetup.exe

Can anyone help me how to convert the php link to real url using vb.net or c#?

Because when I make a program to check file information in vb.net using HEAD method the file name not " PictureFinderSetup.exe " but " downloads.php ? action=download_now&id=2991&evp=113a02f49ca8ac11b566336b984b1655&file=1" .

It cannot be done without contacting the server. Only the server knows the exact mapping. From Fiddler: Request

GET http://www.techspot.com/downloads.php?action=download_now&id=2991&evp=113a02f49ca8ac11b566336b984b1655&file=1 HTTP/1.1
...

Response

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Fri, 27 Sep 2013 17:26:14 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://www.techspot.com/downloads/2991-extreme-picture-finder.html

To get the information you can use WebBrowser or HttpWebResponse to get data you need. How can I use VB.Net to read the content returned from a URL?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM