FileStream读取文件代码
//文件完整路径
string fileName = this.FileUpload1.PostedFile.FileName;
//创建文件流
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
//创建byte数字
Byte[] bytes = new Byte[fs.Length];
//写入缓冲区
fs.Read(bytes, 0, Convert.ToInt32(fs.Length));
fs.Close();
string fileName = this.FileUpload1.PostedFile.FileName;
//创建文件流
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
//创建byte数字
Byte[] bytes = new Byte[fs.Length];
//写入缓冲区
fs.Read(bytes, 0, Convert.ToInt32(fs.Length));
fs.Close();