Hi
I’m developing a tool that will copy folder and directories from one location to another..
It seems to be working, but it has a few issues.
The main issue is, when the tool is copying, if I select something else on my desktop, the new tool seems to crash. This is not the case, but it seems to pause and then resumes after a small delay.
Its like it using all my processor and when something else want to sue the processor it kicks up a fuss.
CPU used 40-50%
Memory Used 23,3600
The copy function I have created is
I’m developing a tool that will copy folder and directories from one location to another..
It seems to be working, but it has a few issues.
The main issue is, when the tool is copying, if I select something else on my desktop, the new tool seems to crash. This is not the case, but it seems to pause and then resumes after a small delay.
Its like it using all my processor and when something else want to sue the processor it kicks up a fuss.
CPU used 40-50%
Memory Used 23,3600
The copy function I have created is
VB.NET:
Public Sub copyDirectory(ByVal strtoROOTlocation As String, ByVal strrootfromName As String, ByVal root As DirectoryInfo, ByVal intIndex As Integer, ByVal video As Boolean)
Dim strfromDirectoryFullPath As String = root.FullName
Dim strtoDrectoryName As String
Dim blcopy As Boolean
If intIndex = 0 Then
strtoDrectoryName = ""
Else
strtoDrectoryName = "\" + root.Name
End If
frmmain.tracking.setprocess(strtoDrectoryName, (root.GetFiles.Count() * 2))
frmmain.tracking.setracking("******" + strtoDrectoryName, "full")
If root.Name = "video" Then
blcopy = video
Else
blcopy = True
End If
If blcopy Then
For Each fiifiles As FileInfo In root.GetFiles
'This will stop Un needed files being copied
If Not fiifiles.Extension = ".doc" And Not fiifiles.Extension = ".fla" And Not fiifiles.Extension = ".db" Then
frmmain.tracking.alterprocess(1, fiifiles.Name)
frmmain.tracking.setracking("********" + fiifiles.Name, "full")
My.Computer.FileSystem.CopyFile(strfromDirectoryFullPath + "\" + fiifiles.Name, strtoROOTlocation + "\" + strtoDrectoryName + "\" + fiifiles.Name, True)
frmmain.tracking.alterprocess(1, "")
Else
frmmain.tracking.setracking("*Extension NOT copies " + fiifiles.Extension, "error")
frmmain.tracking.setracking("**Size " + fiifiles.Length.ToString, "error")
frmmain.tracking.setracking("**Path - " + fiifiles.FullName, "error")
End If
Next ' END Root Folder - Content Loop
Else
frmmain.tracking.setracking("*Videos Not Copied ", "error")
frmmain.tracking.setracking("**Path - " + root.FullName, "error")
End If 'END IF (NO video)
For Each driirectory As DirectoryInfo In root.GetDirectories
frmmain.tracking.endprocess()
copyDirectory(strtoROOTlocation + "\" + strtoDrectoryName, strtoROOTlocation + "\" + strtoDrectoryName, driirectory, intIndex + 1, video)
Next ' END Root Folder - Content Loop
End Sub