Public Class MainClass
Public Shared Sub Main()
CreateShortcut("Demo", "http://www.a.net/")
End Sub
Public Shared Sub CreateShortcut(ByVal Title As String, ByVal URL As String)
Dim strFavoriteFolder As String
strFavoriteFolder = System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites)
Dim objWriter As System.IO.StreamWriter = System.IO.File.CreateText(strFavoriteFolder & "\" & Title & ".url")
objWriter.WriteLine("[InternetShortcut]")
objWriter.WriteLine("URL=" & URL)
objWriter.Close()
End Sub
End Class
|