vb.net当前文件夹 vb读取文件夹

VB.NET 创建文件夹

用Directory.CreateDirectory即可创建文件夹:

创新互联建站-专业网站定制、快速模板网站建设、高性价比喀喇沁网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式喀喇沁网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖喀喇沁地区。费用合理售后完善,十余年实体公司更值得信赖。

' 建立目录

If Not Directory.Exists("C:\负屃\"  TextBox1.Text) Then '检查文件夹是否存在

Directory.CreateDirectory("C:\负屃\"  TextBox1.Text)  '不存在,创建文件建夹

End If

你的例子是因为少了一个"\"引起的,正确的如下:

Dim fsotest As New FileSystemObject

If fsotest.FileExists("C:\负屃\"  TextBox1.Text) = False Then

fsotest.CreateFolder("C:\负屃\"  TextBox1.Text) '这里你少了一个\

End If

MsgBox("创建成功")

vb.net 2010 打开当前文件夹下的文件

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim AppPath As String = Directory.GetCurrentDirectory() '获取应用程序的当前工作目录 Process.Start(AppPath) '打开当前目录 End Sub

我也找来的,只找到这个,希望对你有帮助。

VB.NET获取目录文件夹名称

Dim

dir

As

New

IO.DirectoryInfo("C:\TDDownload")

//

目录下就一个文件夹

If

dir.GetDirectories.Length

Then

MessageBox.Show(dir.GetDirectories.GetValue(0).ToString())

End

If

//

目录下多个文件夹

'For

Each

d

As

IO.DirectoryInfo

In

dir.GetDirectories

'

MessageBox.Show(d.FullName)

'Next

[VB.NET]当前活动资源管理器窗口某文件夹被选定,请问获取该选定的文件夹的路径?

OpenFileDialog openFile = new OpenFileDialog();

openFile.Multiselect = true;

openFile.Filter = "图片 (*.jpg)|*.jpg|所有文件 (*.*)|*.*";

if (openFile.ShowDialog() == DialogResult.OK)

{

string ss = openFile.FileName;

string ww = openFile.FileName.Remove(openFile.FileName.Length - 4, 4);

File.Copy(ss, @"..\..\picture\" + Path.GetFileName(ss));

}

上面是先获取路径,在把图片复制到指定路径下。

vb.net 打开文件夹

System.Windows.Forms.OpenFileDialog

System.Windows.Forms.SaveFileDialog

System.Windows.Forms.FolderBrowserDialog

以上三个类均能够很好的解决楼主的需求。

具体的请lz自己查msdn

vb.net 文件夹操作

vb.net使用控件FolderBrowserDialog1,在程序中:

'设置对话框中在树视图控件上显示的说明文本

Me.FolderBrowserDialog1.Description = "请选择输出报表所在路径:"

'设置从其开始浏览的根文件夹

Me.FolderBrowserDialog1.SelectedPath = "c:\"

If Me.FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then

'取得全路径(包含文件名)

reportPath1 = System.IO.Path.GetFullPath(Me.FolderBrowserDialog1.SelectedPath)

'设定text显示文件名

txtReport1.Text = reportPath1

setReportList()

End If

在setReportList()中针对你所需要的文件进行操作等


网站题目:vb.net当前文件夹 vb读取文件夹
转载来于:http://lszwz.com/article/hpjspp.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款