does anybody know how I would extract the URL from the files saved in the IE favourites list?
The .URL files IE saves it as just seems to have the html code for that site. I would like to be able to get the address for that site...
any ideas welcome
Printable View
does anybody know how I would extract the URL from the files saved in the IE favourites list?
The .URL files IE saves it as just seems to have the html code for that site. I would like to be able to get the address for that site...
any ideas welcome
The ".URL" is essentially an INI file, so the INI file manipulation APIs will retrieve/set the data.
HTH :)VB Code:
Option Explicit Private Declare Function GetPrivateProfileString Lib "kernel32" _ Alias "GetPrivateProfileStringA" _ (ByVal lpApplicationName As String, _ ByVal lpKeyName As Any, _ ByVal lpDefault As String, _ ByVal lpReturnedString As String, _ ByVal nSize As Long, _ ByVal lpFileName As String) As Long Private Sub Form_Load() Dim File As String, Str As String * 255 File = "D:\Documents and Settings\MeIMyself\Favorites\KJ\InstallShield.URL" Call GetPrivateProfileString("InternetShortcut", "URL", "", Str, 255, File) MsgBox Str End Sub
thanks a lot KayJat, but is the only way to do it with API?
Well...You could open up the ".URL" file as plain text (view it in Notepad to get to know the general layput) and parse out the "[SECTION_NAME]" followed by "KEYNAME=" and finally by the Value of that Key.
API's are easier to use, IMO
Regards
KayJay
I can remember when I first mentioned API's to my tutor, he told me to stay away from them until I have a much more solid base.. and arn't api's kinda cheating?
Thanks a lot though KayJay
APIs aren't cheating. They're just a quicker way to get what you're doing done. Besides, that's why the functions are there - so you don't have to reinvent the [slower] wheel.
Another way you could do this is by using VB's file functions.