How do I open a windows explorer window with a specific folder selected
I have a winform application and this winform application has created few files. I want to implement "find target" function in my application to show those files. Those files located in a same fold开发者_StackOverflow中文版er. See the picture:
Let's say that I have created few files in "C:\Test\"
folder and this folder has this file: "C:\Test\File1.txt"
. How to create "find target" functionality using VB.NET?
Use Process.Start()
to start the Windows Explorer:
Process.Start("explorer.exe", "/select," & "FILETOSELECT")
With the /select, [file]
parameter, you can highlight the file.
Take a look at this article where it specifies the arguments, explorer.exe takes in
Then use System.Diagnostics.Process.Start
精彩评论