MyTimeClock/Source/MyTimeClock/RyLine/Program.cs
鑫Intel e45b255752 2020-12-18 V2.0.2012.1801
*.[新增]新增hosts设置命令行参数。
2020-12-18 15:54:23 +08:00

42 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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());
}
}
}