Hola:
Quiero partir archivo con C#, gracias a los compañeros del foro he sacado este código.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO; // No olvidar.
namespace Partir_Archivo
{
class Program
{
static void Main(string[] args)
{
const int CHUNKSIZE = 1024 * 1024;
byte[] buffer;
int i = 1;
FileStream infile = new FileStream(@"Illusion of Time (E).smc", FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(infile);
reader.BaseStream.Position = 0;
buffer = reader.ReadBytes(CHUNKSIZE);
while (buffer.Length != 0)
{
FileStream outfile = new FileStream(@"File_" + i + ".bin", FileMode.CreateNew, FileAccess.Write);
BinaryWriter writer = new BinaryWriter(outfile);
writer.Write(buffer);
writer.Flush();
writer.Close();
outfile.Close();
buffer = reader.ReadBytes(CHUNKSIZE);
i++;
}
reader.Close();
infile.Close();
}
}
}
Lo que quiero hacer.
El bankswap.exe solo coge archivos y los partes por la mitad, por ejemplo, tengo un archivo que pesa 2048 KB, lo parte justamente a la mitad a 1024 KB cada uno y lo nombra así:
Archivo_1.bin y Archivo_2.bin
Por eso quiero saber que hace, para programarlo en C#.
Descargar (http://magno.romhackhispano.org/BankSwap.exe) BankSwap.exe que está hecho con VC++. (No tengo el código fuente).
Saludos.
No entiendo, ya tienes un programa en C# que lo hace no? entonces que buscas?