锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 开源技术 / C#开源英语 / 分割文件
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

分割文件


简介

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),然后点击开始按钮。

虽然分裂进程正在运行,关闭按钮将不会退出申请;相反,它会被最小化到托盘,使得意外退出该应用程序将被避免。

时恢复项目在将来,如果源文件已被移动或改变,则应用程序将提示选择旧的源文件,以使零件将始终是相同的源文件。

bug报告

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”。如果报告错误,应用程序将被更新,你的名字将被添加,与你发现错误,请在下面的历史部分的细节。当您报告错误,请把您的项目文件与他们一起。

历史

  • August 05, 2008
    • New functionality to shutdown the computer with force and for normal shutdown has been added.
    • New functionality to show the approximate time to complete the task has been added.
  • 2008年8月5日
    • 新的功能,以关闭计算机与力和对正常关机已添加。
    • 新的功能,以显示的近似时间,以完成任务已被添加。

文件分割与合并工具


简介

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的事件。

描述

拆分Merge.VBA

This class has two primary methods SplitFile and MergeFile.

SplitFile

Splits files into smaller chunk files.

  • FileName: File name to split with full path
  • OutputPath: Output folder name where the chunk files will be created. Chunk files will be created with the same name as input file with suffix of sequence number (e.g.: bigfile.exe.001)
  • DeleteFileAfterSplit: Boolean value indicating, whether to delete the input file after splitting.
  • ChunkSize: Long value indicating the chunk size in bytes.

MergeFile

Merges all the chunk files into one file.

  • FileName: First chunk file name with full path or the file name with full path (In this casec:\bigfile.exe.001 or c:\bigfile.exe)
  • OutputPath: Output folder name where the merged file will be created
  • DeleteFilesAfterMerge: Boolean value indicating, whether to delete the chunk file after merge.

Both these methods are thread safe and can be called as background threads

这个类有分割文件和合并文件中的两个主要方法。

分割文件

文件拆分成更小的块文件。

  • 文件名:文件名分裂与完整路径
  • OutputPath:将在其中创建块文件输出文件夹的名称。块文件将具有相同的名称与序列号后缀输入文件创建(比如:bigfile.exe.001)
  • 删除文件分割后:布尔值,指示,无论是拆分后删除输入文件。
  • 块大小:长值,表示以字节为单位的块大小。

合并文件

合并文件合并所有块文件合并成一个文件。

  • 文件名:完整路径或完整路径的文件名第一个块的文件名(:\ bigfile.exe.001或c:在这个CASEC\ bigfile.exe)
  • OutputPath:输出文件夹名,其中合并后的文件将被创建
  • DeleteFile AfterMerge:布尔值,指示,无论是合并后删除块文件。

这两种方法都是线程安全和可称为后台线程。

活动

This class has 3 events.

  • FileSplitCompleted  - This event is raised after the split process is completed
  • FileMergeCompleted - This event is raised after the merge process is completed
  • UpdateProgress - This event is raised to notify the client about the progress. Raised after each chunk file is created.

这个类有3个事件。

  • FileSplitCompleted  - 引发此事件分割过程完成后
  • FileMergeCompleted - 引发此事件在合并过程完成后
  • UpdateProgress - 引发此事件通知客户端有关的进展情况,在创建每个块文件后引发。

使用拆分合并类

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.

事件和分割过程相同。

演示配备了一个全功能的例子。

友情链接
版权所有 Copyright(c)2004-2024 锐英源软件
统一社会信用代码:91410105098562502G 豫ICP备08007559号 最佳分辨率 1440*900
地址:郑州市金水区文化路97号郑州大学北区院内南门附近