Hi All,
I am very new to VB.NET and creating small project to that will copy all files from a DVD to a folder in the Hard Drive. While doing the copy around 30% I got the following error:
************** Exception Text **************
System.IO.IOException: Insufficient system resources exist to complete the requested service. at
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at
System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity
dirSecurity) at
System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) at
System.IO.Directory.CreateDirectory(String path) at
Microsoft.VisualBasic.FileIO.FileSystem.CopyOrMove File(CopyOrMove operation, String sourceFileName,
String destinationFileName, Boolean overwrite, UIOptionInternal showUI, UICancelOption onUserCancel)at
Microsoft.VisualBasic.MyServices.FileSystemProxy.C opyFile(String sourceFileName, String destinationFileName, UIOption showUI, UICancelOption onUserCancel) at
Transfer_DVD.Transfer.ProcessFileCopy() at
Transfer_DVD.Transfer.btnCopyDVD_Click(Object sender, EventArgs e) at
System.Windows.Forms.Control.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent) at
System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ButtonBase.WndProc(Message& m) at
System.Windows.Forms.Button.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m) at
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Here is the code I am running to copy the files:
Me.ToolStripProgressBar1.Visible = True
Dim strFiles As ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(Me.cboCDDrives.Tex t, FileIO.SearchOption.SearchAllSubDirectories, "*.*")
Me.ToolStripProgressBar1.Maximum = strFiles.Count
For nCount As Integer = 0 To strFiles.Count - 1
Dim strFoundFile As String = strFiles(nCount)
Me.ToolStripProgressBar1.Value = nCount
My.Computer.FileSystem.CopyFile(strFoundFile, strCopyToFolder & strFoundFile.Substring(3), FileIO.UIOption.OnlyErrorDialogs, FileIO.UICancelOption.DoNothing)
Next
Me.ToolStripProgressBar1.Value = strFiles.Count
There is more code than this, but this is the part where the file copy is being done.
I would appreciate if anybody can help debug this to find out what is causing the exception to happened.
Thanks!
--
Edhy Rijo