Adding Favorites : Environment Setting « Windows System « VB.Net






Adding Favorites

   
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

   
    
    
  








Related examples in the same category

1.Get System Exit CodeGet System Exit Code
2.Has Shutdown StartedHas Shutdown Started
3.Get Machine NameGet Machine Name
4.Get System New Line CodeGet System New Line Code
5.Get OS VersionGet OS Version
6.Get Processor CountGet Processor Count
7.Get Sysstem DirectoryGet Sysstem Directory
8.Get Tick CountGet Tick Count
9.Get .Net Runtime Environment Version NumberGet .Net Runtime Environment Version Number
10.Get Working SetGet Working Set
11.Display System Stack TraceDisplay System Stack Trace
12.List your environment SettingList your environment Setting
13.Get Environment Variable by NameGet Environment Variable by Name
14.Use the Environment.GetFolderPath method to return and display the path associated with the folder parameter.