VB

һνIEļļ
    IEĲ˵ѡ ļ|͵ /򵼽ղؼеַһHTMLļ
档VBʵĹأܼ򵥡
    VBĲ˵ѡ Projects | References ѡڵReferencesԻAvailable References
бѡMicrosoft Internet Controlsѡȷť
    ڳм¶壺
    Dim dc As New SHDocVw.ShellUIHelper
    Ȼڳִ䣺
    dc.ImportExportFavorites False, "c:\a.html"
    ͿԽղؼеݵ C:\a.html ˣҪHTMLļӵղؼУֻҪ
FalseΪTrueͿˡڵ/ɹ֮󣬲ҪµͷŶ
    Set dc = Nothing

IEղؼ
    IEеġղء˵µʵǴ洢WindowsղļµһЩURLΪ׺ıļ
ϣһURLļ䣺
[InternetShortcut]
URL=http://member.netease.com/~blackcat
    ļļǳڡղء˵еĲ˵ʾλWindows
һЩϵͳļУ桢ʼղؼУľ·
ǳ
    Ƚ¹ļȻForm1мһCommandButtonؼȻForm1Ĵ봰м´룺

Option Explicit

Private Const NOERROR = 0
Private Const CSIDL_FAVORITES = &H6

Private Declare Function SHGetPathFromIDList _
        Lib "shell32.dll" Alias "SHGetPathFromIDListA" _
        (ByVal pidl As Long, _
        ByVal pszPath As String) As Long

Private Declare Function SHGetSpecialFolderLocation _
        Lib "shell32.dll" _
        (ByVal hwndOwner As Long, _
        ByVal nFolder As Long, _
        pidl As Long) As Long
   
Private Function GetSpecialPath(CSIDL As Long) As String
    Dim r As Long
    Dim path As String
    Dim pidl As Long
   
    'ָļлpidl
    r = SHGetSpecialFolderLocation(Me.hWnd, CSIDL, pidl)
   
    If r = NOERROR Then
        path = Space$(512)
        r = SHGetPathFromIDList(ByVal pidl, ByVal path)
        GetSpecialPath = Left$(path, InStr(path, Chr$(0)) - 1)
        Exit Function
    End If

    GetSpecialPath = ""
End Function

Private Sub Command1_Click()
    Dim URLpath As String
    Dim CSIDLpath As String
    Dim nameofLink As String
    Dim fileInternet As Integer
  
    'URLַ
    URLpath = "http://cbinews.com/jyb/"
  
    'ղؼеļλ
    CSIDLpath = GetSpecialPath(CSIDL_FAVORITES) & "\"
   
    '½ӵ
    nameofLink = "õ.url"
   
    'ļ
    fileInternet = FreeFile
   
    'Internetݷʽ浽ļ
    Open CSIDLpath & nameofLink For Output As #fileInternet
    Print #fileInternet, "[InternetShortcut]"
    Print #fileInternet, "URL=" & URLpath
    Close #fileInternet
End Sub

    г򣬵Command1ȻٵϵĿ|ղؼв˵ԿõԵѾ
ղؼˡ
    Ҫݷʽ뵽ϣֻҪ壺
    Private Const CSIDL_DESKTOPDIRECTORY = &H10
    ȻCSIDLpath = GetSpecialPath(CSIDL_FAVORITES) & "\"Ϊ
	CSIDLpath = GetSpecialPath(CSIDL_DESKTOPDIRECTORY) & "\" Ϳӿݷʽ档
    :Private Const CSIDL_STARTMENU = &HB
    Ϳӿݷʽʼ˵С
    ϳWin982000VB6ͨ