Java应用程序启动时关闭C#表单

时间:2014-05-15 05:39:55

标签: c# java process launcher process.start

我在C#中有一个表单(进度条),双击.exe后开始。 我想在java应用程序启动后关闭表单。

我如何实现它?

static class Program
{
    static Form1 myForm;
    static void Main(string[] args)
    {         
            ProcessStartInfo startInfo = new ProcessStartInfo();
            // Prevents the cmd window for the batch file from showing up
            startInfo.CreateNoWindow = true;
            startInfo.UseShellExecute = false;
            // Absolute path to prevent running smartstart.bat from some other path
            startInfo.FileName = System.AppDomain.CurrentDomain.BaseDirectory + @"/myBat.bat";
            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
            startInfo.Verb = "runas";
            Process process = Process.Start(startInfo);
            myForm = new Form1();
            System.Windows.Forms.Application.Run(myForm);
    }

}

如何检查java应用程序是否已启动?

0 个答案:

没有答案