C#读取文件到byte数组
int MoldSetDataLen = 0;
byte[] MoldSetData = new byte[0x80000];
StringBuilder FilePath = new StringBuilder();
OpenFileDialog OpenFilePath = new OpenFileDialog();
OpenFilePath.Multiselect = false;
OpenFilePath.Title = "请选择文件";
OpenFilePath.Filter = "文件(*.cdb*) | *.cdb*";
if (OpenFilePath.ShowDialog() == true)
{
FilePath.Clear();
FilePath.Append(OpenFilePath.FileName);
FileStream File = new FileStream(FilePath.ToString(), FileMode.Open, FileAccess.Read);
MoldSetDataLen = (int)File.Length;
File.Read(MoldSetData, 0, MoldSetDataLen);
}