Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Error with rotating image with file copy

$
0
0
Ok so i have been trying to copy a folder to a new destination (in which i have achieved)
and show a rotating image while the copy is in progress but i am having issues with
the rotating image showing on large single fies inside the folder.

This is what i have.

Form1 - this is the code that is run when the go button is clicked
Code:

        If PathTextBox.Text = "" Or DestinationTextBox.Text = "" Then
            MsgBox("You have not selected a Directory and/or a Destination!!!", MsgBoxStyle.Exclamation)
        Else



            Me.Validate()
            Me.PlansBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.Backup_PlansDataSet)

            Dim sourcepath As String = PathTextBox.Text
            Dim DestPath As String = DestinationTextBox.Text
            MoveAllItemsTo(sourcepath, DestPath)

            LoaderImageBox.Visible = True
            ProgressBar1.Maximum = IO.Directory.GetFiles(sourcepath, "*", IO.SearchOption.AllDirectories).Length
            For Each file In IO.Directory.GetFiles(sourcepath, "*", IO.SearchOption.AllDirectories)
                ProgressBar1.Value += 1
                'LoaderImageBox.Visible = True
                'LoaderImageBox.Image.RotateFlip(RotateFlipType.Rotate90FlipNone)
                ' LoaderImageBox.Refresh()
            Next

MoveAllItemsTo
Code:

Imports System.Runtime.CompilerServices
Imports System.IO

Module CheckFolderexist

    Public Sub MoveAllItemsTo(ByVal sourcePath As String, ByVal destinationPath As String)
        Dim sourceDirectoryInfo As New System.IO.DirectoryInfo(sourcePath)

        'If the destination folder don't exist then create it
        If Not System.IO.Directory.Exists(destinationPath) Then
            System.IO.Directory.CreateDirectory(destinationPath)
        End If

        Dim fileSystemInfo As System.IO.FileSystemInfo
        For Each fileSystemInfo In sourceDirectoryInfo.GetFileSystemInfos
            Dim destinationFileName As String =
                System.IO.Path.Combine(destinationPath, FileSystemInfo.Name)

            ' Now check whether its a file or a folder and take action accordingly
            If TypeOf fileSystemInfo Is System.IO.FileInfo Then
                System.IO.File.Copy(fileSystemInfo.FullName, destinationFileName, True)
            Else
                ' Recursively call the mothod to copy all the neste folders
                MoveAllItemsTo(fileSystemInfo.FullName, destinationFileName)
            End If
        Next
    End Sub

End Module



can any 1 see why the progress bar and the loader image only appear for small files not 1 large file aka a movie

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>