Сообщение от Den
почему ошибка?
|
А кто будет под массивы память выделять?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace bite
{
public partial class Form1 : Form
{
public Byte[] a1, a2;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
Byte[] arr = File.ReadAllBytes(openFileDialog1.FileName);
a1 = new byte[arr.Length];
a2 = new byte[arr.Length];
for (int i = 0; i < arr.GetLength(0) / 2; i++)
a1[i] = arr[i];
for (int i = arr.GetLength(0) / 2; i < arr.GetLength(0); i++)
a2[i - arr.GetLength(0)/2] = arr[i];
}
}
}