The two-level copy command is used in the combination. Can be combined with a number of files, in fact, the total length of the test command line can theoretically achieve a combination of infinite split file, but the practical value is not high, millions more than a single document This single-threaded method appears inefficient, and should use more excellent algorithm for segmentation and combination.
This procedure can only be categorized as "toys".
Using System;
Using System.Drawing;
Using System.Collections;
Using System.ComponentModel;
Using System.Windows.Forms;
Using System.Data;
Namespace Filesplit
{
<summary>
Summary description of the Form1.
</summary>
public class Form1:System.Windows.Forms.Form
{
Private System.Windows.Forms.TextBox TextBox1;
Private System.Windows.Forms.TextBox TextBox2;
Private System.Windows.Forms.Button button1;
Private System.Windows.Forms.Button button2;
Private System.Windows.Forms.OpenFileDialog OFD;
Private System.Windows.Forms.Label Label1;
Private System.Windows.Forms.Label Label2;
<summary>
The required designer variable.
</summary>
Private System.ComponentModel.Container components = null;
Public Form1 ()
{
//
Required for Windows Forms Designer support
//
InitializeComponent ();
//
TODO: Add any constructor code after the InitializeComponent call
//
}
<summary>
Clean up all resources that are in use.
</summary>
protected override void Dispose (bool disposing)
{
if (disposing)
{
if (Components!= null)
{
Components. Dispose ();
}
}
Base. Dispose (disposing);
}
Code generated #region the Windows forms Designer
<summary>
Designer supports required methods-do not use the Code editor to modify
The contents of this method.
</summary>
private void InitializeComponent ()
{
This.textbox1 = new System.Windows.Forms.TextBox ();
This.textbox2 = new System.Windows.Forms.TextBox ();
This.button1 = new System.Windows.Forms.Button ();
This.button2 = new System.Windows.Forms.Button ();
THIS.OFD = new System.Windows.Forms.OpenFileDialog ();
This.label1 = new System.Windows.Forms.Label ();
This.label2 = new System.Windows.Forms.Label ();
This. SuspendLayout ();
//
TextBox1
//
This.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
This.textBox1.Location = new System.Drawing.Point (16, 16);
This.textBox1.Name = "TextBox1";
This.textBox1.ReadOnly = true;
This.textBox1.Size = new System.Drawing.Size (376, 21);
This.textBox1.TabIndex = 0;
This.textBox1.Text = "File Path";
//
TextBox2
//
This.textBox2.Location = new System.Drawing.Point (56, 48);
This.textBox2.Name = "TextBox2";
This.textBox2.Size = new System.Drawing.Size (72, 21);
This.textBox2.TabIndex = 1;
This.textBox2.Text = "";
//
Button1
//
This.button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
This.button1.Location = new System.Drawing.Point (200, 48);
This.button1.Name = "Button1";
This.button1.Size = new System.Drawing.Size (272, 24);
This.button1.TabIndex = 2;
This.button1.Text = "Split";
This.button1.Click + = new System.EventHandler (This.button1_click);
//
Button2
//
This.button2.FlatStyle = System.Windows.Forms.FlatStyle.System;
This.button2.Location = new System.Drawing.Point (400, 16);
This.button2.Name = "Button2";
This.button2.Size = new System.Drawing.Size (72, 24);
This.button2.TabIndex = 3;
This.button2.Text = "browsing";
This.button2.Click + = new System.EventHandler (This.button2_click);
//
Label1
//
This.label1.Location = new System.Drawing.Point (16, 48);
This.label1.Name = "Label1";
This.label1.Size = new System.Drawing.Size (32, 23);
This.label1.TabIndex = 4;
This.label1.Text = "Size";
//
Label2
//
This.label2.Location = new System.Drawing.Point (136, 48);
This.label2.Name = "Label2";
This.label2.Size = new System.Drawing.Size (56, 16);
This.label2.TabIndex = 5;
This.label2.Text = "KB";
//
Form1
//
This. AutoScaleBaseSize = new System.Drawing.Size (6, 14);
This. ClientSize = new System.Drawing.Size (498, 79);
This. Controls.Add (THIS.LABEL2);
This. Controls.Add (THIS.LABEL1);
This. Controls.Add (This.button2);
This. Controls.Add (This.button1);
This. Controls.Add (THIS.TEXTBOX2);
This. Controls.Add (This.textbox1);
This. FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
This. MaximizeBox = false;
This. MinimizeBox = false;
This. Name = "Form1";
This. Text = "Spliter";
This. ResumeLayout (FALSE);
}
#endregion
<summary>
The main entry point for the application.
</summary>
[STAThread]
static void Main ()
{
Application.Run (New Form1 ());
}
int i=1;
Try
{
I=int. Parse (This.textBox2.Text);
if (I <= 0) {System.Exception ee = new Exception (); throw EE;}
i*=1000;
}
Catch
{
i=0;
System.Windows.Forms.MessageBox.Show ("Input split number is incorrect");
Return
}
#region "Assign Folder"
int count=1;
String WORKPATH=OFD. Filename.tostring () + "Split";
while (true)
{
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.