VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th

by Nepveux Software (4 Submissions)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 20th February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get the URL from a Windows Internet Shortcut

Rate Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th



'MyURL = GetURLFromFile("c:\windows\favorites\my shortcut.url")
'returns http:// or other address.

Private Function GetURLFromFile(Filename As Variant) As String
Dim Useless, URL As String
Open Filename For Input As #1
 Input #1, Useless
 Input #1, URL
If Useless = "[InternetShortcut]" Then
 If Left$(URL, 4) = "URL=" Then
  URL = Right$(URL, Len(URL) - 4)
 ElseIf Left$(URL, 4) = "BASE" Then
  URL = Right$(URL, Len(URL) - 8)
 End If
Else
 Input #1, Useless
 Input #1, Useless
 Input #1, URL
 If Left$(URL, 4) = "URL=" Then
  URL = Right$(URL, Len(URL) - 4)
 ElseIf Left$(URL, 4) = "BASE" Then
  URL = Right$(URL, Len(URL) - 8)
 End If
End If
Close #1
GetURLFromFile = URL
End Function

Download this snippet    Add to My Saved Code

Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th Comments

No comments have been posted about Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th. Why not be the first to post a comment about Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th.

Post your comment

Subject:
Message:
0/1000 characters