Question Unable to rename a file after storing path in an object array

breault

New member
Joined
Aug 11, 2009
Messages
3
Programming Experience
1-3
Hi Guys, I'm having one hell of a time wit this one.
Pretty much I create a string array from a bunch of files that were dropped on a control
after that i use a loops to pass that data into an array of my pictureObjects object (just stores filePath info and some other things)

for some reason after it's been passed to the control the "My.Computer.FileSystem.RenameFile" doesn't seem to work at all... it's a valid file name and everthing.

can anyone see what's i'm doing wrong?

thanks.
mike.


Dim sFileArray() As String = e.Data.GetData(DataFormats.FileDrop)

'load sFileArray into new array of picureObjects
ReDim dropedPicture(sFileArray.Length)
Dim dropedOnPictureBox As Integer

For x As Integer = 0 To sFileArray.Length - 1
'find out what box the pictures were dropped on
Dim i As Integer = 0
Do
If sender.Equals(myBoxSet(i).PictureBox) Then
dropedOnPictureBox = i
Exit Do
End If
i = i + 1
Loop
dropedPicture(x) = New PictureObject(sFileArray(x), dropedOnPictureBox)
Next x


My.Computer.FileSystem.RenameFile(dropedPicture(0).getPath, "testing.jpg")
 
Back
Top