精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
This is a simple but useful utility developed using C# which runs under Microsoft .NET Framework v2.0 or higher. This tool helps in splitting huge files into many small parts and merge them at any time and use it. This is a technique of separating the file bytes into a specified size.
这是基于Microsoft .NET Framework2.0或更高版本C#开发的简单而有用的工具。此工具可帮助拆分大文件成许多小部分,任何时间使用时可把它们合并。这是文件字节分离成指定大小的技术。
To use the demo application, open "SplitFile.exe" from the demo link above. Click File --> New Project, and then save the project at any location at your wish. This project file can be used to resume the splitting process in future, if interrupted in between. Then, click the Browse button to select the source file (the huge file which has to be split). Now, a new panel will be visible at the bottom which shows the total size of the source file in bytes, and the remaining size indicates the remaining size to be split, which is updated after adding or removing each file.In the above window, click on the Browse button to add the part name and location. And then, enter the size of the new part, and then click Add Part button so that the part will be added to the list and the remaining size will be updated. Do this step continuously till the remaining size is 0. Increase the buffer size to increase the speed of the process. Then, click on the Start button to start splitting the file. This process does not damage the sourcefile.
为了使用演示应用程序,从上面的演示连接下载文件,打开“SplitFile.exe”。点击文件 - >新建项目,然后将项目保存在你希望的任何位置。该项目文件在将来可用于恢复分裂过程,只要过程没中断就没事。然后,单击浏览按钮选择源文件(里面有被分裂了巨大的文件)。现在,一个新的面板将在哪些显示字节源文件的总大小的底部可见,和剩余大小指示剩余大小要分割,这是添加或删除每个文件后进行更新。在上面的窗口中,单击浏览按钮来添加部件名称和位置。然后,输入新的部分的大小,并依次添加部分按钮,使部分将被添加到列表中,剩余的大小将被更新。连续执行此步骤直到剩余的大小为0增加缓冲器大小,以增加处理的速度。然后,点击开始按钮启动拆分文件。这一过程不会损坏源文件。
Note: Select the checkbox Create Merge file to Join parts to create a batch file to merge the split parts. The batchfile will be created at the same location as that of the project file, containing the name of the project file as prefix. While merging the file using "Merger.bat", all the parts and the batch file must be placed in the same folder.
注:选中该复选框创建合并文件,加入部分创建一个批处理文件合并分割零件。该批处理文件将在相同的位置,该项目文件被创建,其包含项目文件作为前缀的名称。而合并使用“Merger.bat”的文件中,所有的部分和批文件必须放置在相同的文件夹。
The description of the source is given line by line wherever necessary as comments.
源的描述由线在必要的注释中给出的行。
This tool can be used to split any types of file (e.g., video, audio, graphics, images, executables [*.exe], text files, etc.).
The process can be stopped at any time, and can be resumed whenever needed.
To resume the stopped process in future, just drag and drop the project file to the icon at the desktop, or open the application, click File --> Open Project, and then select the project file (*.sp), and click the Start button.
While the splitting process is running, the Close button will not exit the application; instead, it will be minimized to the tray so that accidentally exiting the application will be avoided.
When you resume the project in future, if the source file has been moved or changed, then the application will prompt to select the old source file so that the parts will always be the same as that of the source file.
此工具可用于拆分任何类型的文件(例如,视频,音频,图形,图像,可执行[* .EXE],文本文件等)。
该过程可以停止在任何时间,并在需要时就可以恢复。
要继续在未来停止的过程中,只需拖放项目文件的图标在桌面上,或打开应用程序,点击文件 - >打开项目,然后选择项目文件(*.SP),然后点击开始按钮。
虽然分裂进程正在运行,关闭按钮将不会退出申请;相反,它会被最小化到托盘,使得意外退出该应用程序将被避免。
时恢复项目在将来,如果源文件已被移动或改变,则应用程序将提示选择旧的源文件,以使零件将始终是相同的源文件。
In case of any bugs or suggestions to improve the project, feel free to contact me at "shridhar_tl@ymail.com". If you report bugs, the application will be updated and your name will be added, with details about the bug you found, in the History section provided below. When you report bugs, please send your project files along with them.
如有任何错误或建议,以改善该项目,请随时与我联系“shridhar tl@ymail.com”。如果报告错误,应用程序将被更新,你的名字将被添加,与你发现错误,请在下面的历史部分的细节。当您报告错误,请把您的项目文件与他们一起。
This project consists of a class SplitMerge.vb and a user interface to test the class. Source code is provided as a VS.NET project, so you can download the source and build it with current version of VS.NET. I created and tested this under VS.NET with SP2 under Windows 2000.
This project demonstrates the usage of file streams, threading and events in VB.NET.
该项目包括一个类SplitMerge.vb和用户接口,以测试类。提供源代码作为一个VS.NET项目,这样你就可以下载源和VS.NET的当前版本构建它。我创建并在Windows 2000下VS.NET下测试这种带有SP2。
该项目说明文件流的使用,线程和VB.NET的事件。
This class has two primary methods SplitFile and MergeFile.
SplitFile
Splits files into smaller chunk files.
MergeFile
Merges all the chunk files into one file.
Both these methods are thread safe and can be called as background threads
这个类有分割文件和合并文件中的两个主要方法。
分割文件
文件拆分成更小的块文件。
合并文件
合并文件合并所有块文件合并成一个文件。
这两种方法都是线程安全和可称为后台线程。
This class has 3 events.
这个类有3个事件。
Add a form to your project. Declare SplitMerge class with events.
将窗体添加到您的项目。声明分割合并类的事件。
Private WithEvents _FileSplitMerge As New SplitMerge()
Declare a thread to call the Split and Merge Methods
声明一个线程调用分割和合并方法
Private backgroundThread As System.Threading.Thread
See the demo for other controls
观看演示的其他控件
Private Sub SplitFile() With _FileSplitMerge.ChunkSize = txtChunkSize.Text .FileName = txtFileName.Text .OutputPath = txtOutputFolder.Text .DeleteFileAfterSplit = chkOption.Checked backgroundThread = New _ Threading.Thread(AddressOf .SplitFile)backgroundThread.Start() End With End Sub
After the split process is completed, it will raise the FileSplitCompleted event.
FileSplitCompleted event will return an ErrorMessage, in case of an error it will return the error message else an empty string.
经过分割处理完成后,将提高FileSplitCompleted事件。
FileSplitCompleted事件将返回的ErrorMessage,在发生错误时,将返回错误信息否则一个空字符串。
Private Sub _FileSplitMerge_FileSplitCompleted(ByVal _ ErrorMessage As String) Handles _FileSplitMerge.FileSplitCompleted If ErrorMessage = "" Then MsgBox("File Split process completed") Else MsgBox("File Split process Failed" & NEWLINE & ErrorMessage) End If ResetControls() End Sub
So check for the ErrorMessage to display appropriate message.
因此,检查的错误消息显示相应的信息。
Private Sub MergeFiles() With _FileSplitMerge.FileName = txtFileName.Text .OutputPath = txtOutputFolder.Text .DeleteFilesAfterMerge = chkOption.Checked backgroundThread = New _ Threading.Thread(AddressOf .MergeFile)backgroundThread.Start() End With End Sub
Events are the same as Split process.
Demo comes with a fully functional example.
事件和分割过程相同。
演示配备了一个全功能的例子。