为所有用户启动C#WinForms应用程序

时间:2018-03-12 07:45:42

标签: c# winforms scheduled-tasks

我创建了一个WinForms应用程序,该应用程序由SYSTEM用户下的计划任务启动。唯一的问题是它在后台运行。

是否可以在程序周围编写一个包装器以获取登录用户并将其带到桌面?

using System;
using System.Windows.Forms;

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

0 个答案:

没有答案