110,528
社区成员
发帖
与我相关
我的任务
分享
System.IO.FileStream fs = new System.IO.FileStream(Application.ExecutablePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
byte[] bytes = new byte[fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
fs.Dispose();
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes);
System.IO.FileStream fs1 = new System.IO.FileStream("d:\\1.exe", System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite);
fs1.Write(bytes, 0, bytes.Length);
fs1.Close();
fs1.Dispose();
System.IO.FileStream fs = new System.IO.FileStream(Application.ExecutablePath, System.IO.FileMode.Open,System.IO.FileAccess.Read);
byte[] bytes = new byte[fs.Length - 1];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
fs.Dispose();
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes);
System.IO.FileStream fs1 = new System.IO.FileStream("d:\\1.exe",System.IO.FileMode.Create);
fs1.Write(bytes, 0, bytes.Length);
fs1.Close();
fs1.Dispose();