MyTimeClock/Source/MyTimeClock/RyLine/Program.cs

42 lines
1.4 KiB
C#
Raw Normal View History

using System;
using System.Windows.Forms;
namespace RyLine
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// 修改 EWX_SHUTDOWN 或者 EWX_LOGOFF, EWX_REBOOT等实现不同得功能。
// 在XP下可以看到帮助信息以得到不同得参数
// SHUTDOWN /?
if(args.Length==1)
{
RyCode.RunCodeLine(args[0]);
}
else if (args.Length>1)
{
if(args[0]=="SetAutoRun" && args.Length == 4)
{ ryCommon.ryStart.SetAutoRun(true, args[1], "\""+args[2]+ "\"" + " "+args[3]); }
else if (args[0] == "DelAutoRun" && args.Length == 2)
{ ryCommon.ryStart.SetAutoRun(false, args[1]); }
else if (args[0] == "Hosts" && args.Length == 2)
{
if (System.IO.File.Exists(args[1]))
{
ryCommon.Hosts.AddHosts(ryCommon.RyFiles.ReadAllText(args[1]));
}
}
}
//shoutdown.DoExitWin(shoutdown.EWX_SHUTDOWN + shoutdown.EWX_FORCE);
//Application.Run(new Form1());
}
}
}