A great way of advertising your
site is to offer a link from the desktop
or Start Menu to your site. To do
this, you create a URL file. When
this file is double-clicked, it opens up
the default browser with the Web Site
stored in the file. The structure of the
file is as follows.
URL File
Structure
A URL file has the extension .URL,
and contains the following text:
[InternetShortcut]
URL=http://www.websiteaddress.com
A
Internet Shortcut file that points
towards Allapi.net would have the
format:
[InternetShortcut]
URL=../
Code
The following code creates a
Internet Shortcut on the desktop.
'declare variables
Dim StrURLFile As String
Dim StrURLTarget As String
Dim FileNum As Integer
'initialise Variables
StrURLFile = "C:\Windows\Desktop\KPDHome.url"
StrURLTarget = "../"
FileNum = FreeFile
'Write the Internet Shortcut file
Open StrURLFile For Output As FileNum
Print #FileNum, "[InternetShortcut]"
Print #FileNum, "URL=" & StrURLTarget
Close FileNum
|