// See https://aka.ms/new-console-template for more information
|
using Helpers;
|
using WOLAwaken.Helper;
|
|
Console.WriteLine("Hello, World!");
|
#region 发送方法
|
var SendFun = () => {
|
while (true)
|
{
|
try
|
{
|
new SendWOLPack();
|
}
|
catch (Exception ex)
|
{
|
Console.WriteLine(ex.Message + "\r\n" + ex.StackTrace);
|
}
|
Console.WriteLine("END;");
|
Console.WriteLine("按下回车可以进行下一次发送;");
|
Console.ReadLine();
|
}
|
};
|
#endregion
|
|
var config = Helpers.Tool.GetSystemConfig().baseSysConfg;
|
if (config != null && (!string.IsNullOrWhiteSpace(config.startProject)))
|
{
|
if (config.startProject == "1")
|
{
|
//只监听
|
ReceiveUDPPack.StartReceive();
|
}
|
else if (config.startProject == "2")
|
{
|
//只发送
|
SendFun();
|
}
|
else if (config.startProject == "3")
|
{
|
//监听加发送
|
ReceiveUDPPack.StartReceive();
|
Task.Delay(1500).Wait();
|
SendFun();
|
}
|
else
|
{
|
Console.WriteLine("无选项");
|
}
|
}
|
|
Console.ReadLine();
|