文件转换为流,流通过字节转换为文件
StreamReader sr = new StreamReader(Server.MapPath("~/images/LYF.jpg"));
byte[] bytes=new byte[sr.BaseStream.Length];
sr.BaseStream.Read(bytes, 0,(int)sr.BaseStream.Length);
//Response.Write(bytes.Length.ToString());
FileInfo fileinfo = new FileInfo(Server.MapPath("~/images/lxx.jpg"));
FileStream fs=fileinfo.Create();
fs.Write(bytes, 0, bytes.Length);
fs.Flush();
fs.Close();
byte[] bytes=new byte[sr.BaseStream.Length];
sr.BaseStream.Read(bytes, 0,(int)sr.BaseStream.Length);
//Response.Write(bytes.Length.ToString());
FileInfo fileinfo = new FileInfo(Server.MapPath("~/images/lxx.jpg"));
FileStream fs=fileinfo.Create();
fs.Write(bytes, 0, bytes.Length);
fs.Flush();
fs.Close();