Implement “Open Containing Folder” and highlight file

后端 未结 3 790
北荒
北荒 2020-12-28 16:20

This can be a handy functionality to have in a program that works with files/folders. It\'s easy enough to actually open the containing folder using:

System.         


        
3条回答
  •  自闭症患者
    2020-12-28 16:27

    Execute Explorer.exe with /select, "filename" command line argument

    System.Diagnostics.Process.Start(
        "explorer.exe", 
        string.Format("/select, \"{0}\"", filename));
    

提交回复
热议问题