|
-
Nov 3rd, 2004, 08:37 AM
#1
Thread Starter
Frenzied Member
Moving files...simple app
Hi there,
I am trying to create a program which will create a desired diretcory name, then move all the jpg files from the program directory to the new directory,...
this is what i have done so far....
I can seem to get it to work...please help ....
Dino
VB Code:
Dim strFileName As String
Private Sub btnMove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMove.Click
strFileName = txtFile.Text
IO.Directory.CreateDirectory(strFileName)
IO.File.Move("*.jpg", Application.StartupPath & "\" & strFileName)
IO.Directory.GetFiles(Application.StartupPath, "*.jpg")
End Sub
-
Nov 3rd, 2004, 09:38 AM
#2
Hyperactive Member
Hey, this should work for you:
VB Code:
Private strFileName As String
Private Sub btnMove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMove.Click
strFileName = txtFile.Text
Dim di As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
For Each fi As FileInfo In di.GetFileSystemInfos("*.jpg")
fi.MoveTo("C:\Temp\" & fi.Name)
Next
End Sub
Whadayamean it doesn't work....
It works fine on my machine!

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|