Open a Windows 7 Library in Windows Explorer

前端 未结 6 1024
星月不相逢
星月不相逢 2020-12-21 02:10

How do I open a Windows 7 Library like Documents, Pictures, Music, Videos and all other custom libraries from my app?

6条回答
  •  被撕碎了的回忆
    2020-12-21 02:43

    Find the AppData directory:

    Dim appData As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
    

    Find the documents shortcut and open it in explorer:

    For Each file As String In Directory.GetFiles(appData, "Documents.library-ms", SearchOption.AllDirectories)
        Process.Start(file)
    Next
    

提交回复
热议问题