Horje
c# split large file into chunks Code Example
c# split large file into chunks
public static void SplitFile(string inputFile, int chunkSize, string path)
{
    const int BUFFER_SIZE = 20 * 1024;
    byte[] buffer = new byte[BUFFER_SIZE];

    using (Stream input = File.OpenRead(inputFile))
    {
        int index = 0;
        while (input.Position < input.Length)
        {
            using (Stream output = File.Create(path + "\\" + index))
            {
                int remaining = chunkSize, bytesRead;
                while (remaining > 0 && (bytesRead = input.Read(buffer, 0,
                        Math.Min(remaining, BUFFER_SIZE))) > 0)
                {
                    output.Write(buffer, 0, bytesRead);
                    remaining -= bytesRead;
                }
            }
            index++;
            Thread.Sleep(500); // experimental; perhaps try it
        }
    }
}




Csharp

Related
git find commits by message Code Example git find commits by message Code Example
datatable to array c# Code Example datatable to array c# Code Example
Data at the root level is invalid. Line 1, position 1. Code Example Data at the root level is invalid. Line 1, position 1. Code Example
c# $ string Code Example c# $ string Code Example
c# type from string Code Example c# type from string Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12