Get URL property from file

  • Thread starter Thread starter Zack Trainor
  • Start date Start date
Z

Zack Trainor

Does anyone know of a way to get the URL for an Internet
shortcut given that you have the name of the underlying
file. For example, I have a shortcut pointing to
http://www.yahoo.com stored on my C: drive as:
c:\yahoo.url. Within my program, I already know the
filename, but I can't seem to figure out how to get the
URL from it.

Any ideas would be greatly appreciated!

Thanks, Zack
 
Zack,
Any ideas would be greatly appreciated!

Internet shortcuts are just INI-style text files, and should be fairly
easy to parse. Open one in your favorite text editor and have a look.

There are APIs for manipulating .URL filed, but they are COM based.



Mattias
 
* "Zack Trainor said:
Does anyone know of a way to get the URL for an Internet
shortcut given that you have the name of the underlying
file. For example, I have a shortcut pointing to
http://www.yahoo.com stored on my C: drive as:
c:\yahoo.url. Within my program, I already know the
filename, but I can't seem to figure out how to get the
URL from it.

Any ideas would be greatly appreciated!

Open the file in Notepad and you will see that it is an old-style INI
file. You can use, for example, this class to read the file:

<http://www.mentalis.org/soft/class.qpx?id=6>
 
Back
Top