rt

解决方案 »

  1.   

    http://blog.csdn.net/wuyazhe/article/details/6022771
      

  2.   

    psi.Arguments = "/"" + Environment.GetCommandLineArgs()[0] + "/"";  
    编译通过不了。提示输入“;”
      

  3.   

    public static void TestForKillMyself()  
            {  
                string bat = @"@echo off  
    :tryagain  
    del %1  
    if exist %1 goto tryagain  
    del %0";  
                File.WriteAllText("killme.bat", bat);//写bat文件  
                ProcessStartInfo psi = new ProcessStartInfo();  
                psi.FileName = "killme.bat";  
                psi.Arguments = "/"" + Environment.GetCommandLineArgs()[0] + "/"";  
                psi.WindowStyle = ProcessWindowStyle.Hidden;  
                Process.Start(psi);  
            }  
    太强了
      

  4.   


    public static void TestForKillMyself()  
            {  
                string bat = @"@echo off  
                                    :tryagain  
                                    del %1  
                                    if exist %1 goto tryagain  
                                    del %0";  
                System.IO.File.WriteAllText("killme.bat", bat);//写bat文件   
                System.Diagnostics. ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();  
                psi.FileName = "killme.bat";  
                psi.Arguments = "\"" + Environment.GetCommandLineArgs()[0] + "\"";  
                psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;  
                System.Diagnostics.Process.Start(psi);  
            } 
    不过是价格引用和改个\
      

  5.   

    psi.Arguments = "/"" + Environment.GetCommandLineArgs()[0] + "/"";   
    改为:psi.Arguments = "\"" + Environment.GetCommandLineArgs()[0] + "\"";