【C#学习笔记】自我复制

using System;
using System.IO;
using System.Diagnostics;
namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            string dst = "c:/123.exe";
            if (!File.Exists(dst))
            {
                 File.Copy(Process.GetCurrentProcess().MainModule.FileName,dst);
            }
         
            Console.Read();
        }      
    }
}

 

posted @ 2017-08-27 15:16  Dsp Tian  阅读(554)  评论(0编辑  收藏  举报