wonder_gal
Active member
- Joined
- Jun 5, 2006
- Messages
- 34
- Programming Experience
- 1-3
Hi, I was coding a function which unzips a zip file and then changed the extension from ".csv" to ".txt" but I received this error., "Procedure Call or argument is not valid." The highlighted statement is the line which cause this error. Can someone let me know what's wrong with my arguments?
VB.NET:
Dim fileName As String = Path.GetFullPath("..\")
With OpenZIPFileDialog
.InitialDirectory = fileName
.Filter = "Zip Files (*.zip)|*.zip*"
.FilterIndex = 1
If .ShowDialog() = DialogResult.OK Then
Dim x As New ICSharpCode.SharpZipLib.Zip.FastZip
x.ExtractZip(.FileName, fileName, "csv;xsl")
End If
End With
MsgBox("Congratulations, your file have been unzipped!", MsgBoxStyle.Information, "Sucessfully Unzipped")
Try
[B]FileSystem.Rename("..\testing.csv", "..\testing.txt")[/B]
MsgBox("Congratulations, new txt file being created using NEW method!", MsgBoxStyle.Information, "New File Path")
Catch ex As Exception
MsgBox("Error occured: " & ex.Message, MsgBoxStyle.Information, "Error")
End Try