扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:朱先忠编译 来源:天极开发 2007年11月9日
关键字:
Private Sub CopyFiles(ByVal srcDir As String, ByVal destDir As String) Const BufferSourceTopLine As Integer = 8 Const BufferDestinationTopLine As Integer = 7 Dim rowIndex As Integer = 7 Dim originalForegroundColor As ConsoleColor = Console.ForegroundColor Console.CursorVisible = False Console.Clear() Dim numberOfFiles As Integer numberOfFiles = My.Computer.FileSystem.GetFiles(srcDir).Count Dim pb As New ConsoleProgressBar(numberOfFiles) DisplayHeader(srcDir, destDir) Dim fileCounter As Integer = 1 For Each f As String In My.Computer.FileSystem.GetFiles(srcDir) Dim fi As New System.IO.FileInfo(f) Console.ForegroundColor = ConsoleColor.Green Console.SetCursorPosition(0, rowIndex) Console.Write(fi.Name) If rowIndex < Console.WindowHeight - 1 Then rowIndex += 1 Else Console.MoveBufferArea(0,BufferSourceTopLine, _ Console.WindowWidth, _ Console.WindowHeight - _ BufferSourceTopLine, _ 0, _ BufferDestinationTopLine) End If My.Computer.FileSystem.CopyFile(fi.FullName, destDir &"\" & fi.Name) pb.Update( fileCounter) fileCounter += 1 Next Console.ForegroundColor = originalForegroundColor Console.SetCursorPosition(0, Console.WindowHeight - 1) Console.CursorVisible = True End Sub |
Console.MoveBufferArea(0, _ BufferSourceTopLine, _ Console.WindowWidth, _ Console.WindowHeight - BufferSourceTopLine, _ 0, _ BufferDestinationTopLine) |
Public Sub New(ByVal MaximumValue As Long) m_length = Console.WindowWidth - 10 m_left = 7 m_right = m_left + m_length + 1 m_progressBarRow = 1 m_messageBarRow = m_progressBarRow + 1 m_percentPosition = 4 m_maximumValue = MaximumValue m_currentValue = 0 Initialize() End Sub |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者