2019-09-19 02:13:09 +00:00
|
|
|
|
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]); }
|
2020-12-18 07:54:15 +00:00
|
|
|
|
else if (args[0] == "Hosts" && args.Length == 2)
|
|
|
|
|
{
|
|
|
|
|
if (System.IO.File.Exists(args[1]))
|
|
|
|
|
{
|
|
|
|
|
ryCommon.Hosts.AddHosts(ryCommon.RyFiles.ReadAllText(args[1]));
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-19 02:13:09 +00:00
|
|
|
|
}
|
|
|
|
|
//shoutdown.DoExitWin(shoutdown.EWX_SHUTDOWN + shoutdown.EWX_FORCE);
|
|
|
|
|
//Application.Run(new Form1());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|