在vb.net中打开一个文件夹 [英] open a folder in vb.net
本文介绍了在vb.net中打开一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过单击项目中的命令按钮来打开文件夹/我的计算机以及我如何执行此操作?有人请帮助.....
i want to open a folder/my computer by clicking a command button from my project and how i can perform this??somebody plz help.....
推荐答案
如果我已正确理解了这个问题(如果它仍然相关),我认为这应该是你想要做的:
If I have understood the question correctly (and if it's still relevant), I think this should be what you want to do:
Imports System.Threading
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.MyComputer))
End Sub
End Class
使用FolderBrowserDialog控件。
Use the FolderBrowserDialog control.
只需将以下代码添加到按钮中:
Just add the following code into your button:
Process.Start("explorer.exe", "Path of your file/Folder")
这篇关于在vb.net中打开一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文