Dim path1 As String = "D:\scan"
My.Computer.FileSystem.CreateDirectory(path1)
Dim info As New DirectoryInfo(path1)
If (info.Exists) Then
Dim file As FileInfo = Nothing
file = info.GetFiles.Last
If (file.Extension = ".png") Then
ListBox1.Items.Add(file.FullName)
End If
PictureBox1.ImageLocation = fileName
i = 0
====================================================
For index As Integer = 0 To ListBox1.Items.Count - 1
Dim src1 As String = ListBox1.Items(index.ToString())
If Directory.Exists("D:MyScan\") Then
Dim f1 As String = Path.GetFileName(src1)
dest1 = Convert.ToString("D:\MyScan\") & f1
File.Copy(src1, dest1)
PictureBox1.Image = Nothing
Else
Directory.CreateDirectory("D:\MyScan\")
Dim f1 As String = Path.GetFileName(src1)
dest1 = Convert.ToString("D:\MyScan\") & f1
File.Copy(src1, dest1)
PictureBox1.Image = Nothing
End If
My.Computer.FileSystem.CreateDirectory(path1)
Dim info As New DirectoryInfo(path1)
If (info.Exists) Then
Dim file As FileInfo = Nothing
file = info.GetFiles.Last
If (file.Extension = ".png") Then
ListBox1.Items.Add(file.FullName)
End If
PictureBox1.ImageLocation = fileName
i = 0
====================================================
For index As Integer = 0 To ListBox1.Items.Count - 1
Dim src1 As String = ListBox1.Items(index.ToString())
If Directory.Exists("D:MyScan\") Then
Dim f1 As String = Path.GetFileName(src1)
dest1 = Convert.ToString("D:\MyScan\") & f1
File.Copy(src1, dest1)
PictureBox1.Image = Nothing
Else
Directory.CreateDirectory("D:\MyScan\")
Dim f1 As String = Path.GetFileName(src1)
dest1 = Convert.ToString("D:\MyScan\") & f1
File.Copy(src1, dest1)
PictureBox1.Image = Nothing
End If
No comments:
Post a Comment