如何在app第一次运行时打开表单

时间:2017-11-11 20:20:20

标签: c#

我试过这个但是没有用。如果你能帮助我,我将不胜感激......................................... ...

static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        string filename = "counter.txt";
        if (!System.IO.File.Exists(filename))
        {
            System.IO.File.WriteAllText(filename, "1");
            Application.Run(new FormLogin());
        }
        else
        {
            Application.Run(new Form1());
        }


    }
}

}

0 个答案:

没有答案