vb.net浏览文件 vbnet fileopen

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二进制怎么读取文件?一、二进制文件读写
1、写二进制数据到指定目录
==将barray字节数组中的数据创建在strFilename目录文件下,存储格式为二进制,False表示不添加,直接覆盖创建 。
2、从指定路径下读取二进制数据到数组
==将目录中的文件读取到barry字节数组中,即读取二进制文件 。
二、字符文件的读写
1、 将txtFile控件中的字符写到srtFileName指定目录,以创建方式 。
2、从srtFileName目录中的文件读取到txtFile控件
用VB(或者VB.net)怎样打开“浏览文件夹窗口”?(如图)Private Sub Command1_Click()
Dim sf As Object
Set sf = CreateObject("Shell.Application").BrowseForFolder(0, "选择文件夹", 0, "")
If Not sf Is Nothing Then
MsgBox "选择vb.net浏览文件的文件夹是"vbCrLfsf.self.Path
End If
Set sf = Nothing
End Sub
用VB.NET制作图片浏览器时,打开图片文件时只能一张一张的打开,如何设置可以一次打开多个图片文件Public Class Form1
Dim Files() As String
Dim ImgNum As Integer = 0
Dim CurIdx As Integer = 0
Sub OpenFiles()
InitialSet()
Try
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
If Not OpenFileDialog1.FileNames Is Nothing Then
Files = OpenFileDialog1.FileNames
Else
Files(0) = OpenFileDialog1.FileName
End If
ImgNum = Files.Length
Dim s As String = String.Format("vb.net浏览文件你共打开 {0} 张图片", ImgNum)
Me.Text = s
StateSet()
CurIdx = 1
DisplayImage(CurIdx)
Else
StateSet()
Me.PictureBox1.Image = Nothing
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Sub InitialSet()
Me.OpenFileDialog1.Multiselect = True
Me.OpenFileDialog1.Filter = "(*.jpg)|*jpg"
Me.OpenFileDialog1.FilterIndex = 0
ImgNum = 0
CurIdx = 0
If Not Files Is Nothing Then
Array.Clear(Files, 0, Files.Length - 1)
End If
End Sub
Sub DisplayImage(ByRef Idx As Integer)
If IO.Path.GetExtension(Files(Idx - 1)).ToLower = ".jpg" Then
Me.PictureBox1.Load(Files(Idx - 1))
End If
StateSet()
End Sub
Sub StateSet()
If ImgNum1 Then
Me.btnNext.Enabled = True
Else
Me.btnNext.Enabled = False
Me.btnPervious.Enabled = False
Exit Sub
End If
If CurIdx1 And ImgNum1 Then
Me.btnPervious.Enabled = True
Else
Me.btnPervious.Enabled = False
End If
If CurIdxImgNum And ImgNum1 Then
Me.btnNext.Enabled = True
Else
Me.btnNext.Enabled = False
End If
End Sub
Sub NextIamge(ByRef Idx As Integer)
If IdxImgNum Then
Idx += 1
Else
Exit Sub
End If
DisplayImage(Idx)
End Sub
Sub PerviousIagme(ByRef Idx As Integer)
【vb.net浏览文件 vbnet fileopen】If Idx1 Then
Idx -= 1
Else
Exit Sub
End If
DisplayImage(Idx)
End Sub

推荐阅读