NoSugarNet/Sample/NoSugarNet.ClientCli/Program.cs

30 lines
925 B
C#
Raw Normal View History

2024-01-22 11:58:24 +08:00
using NoSugarNet.ClientCore;
namespace NoSugarNet.ClientCli
{
internal class Program
{
static string Title = "NoSugarNetClient";
2024-01-22 11:58:24 +08:00
static void Main(string[] args)
{
2024-01-23 17:06:47 +08:00
if (!Config.LoadConfig())
{
Console.WriteLine("配置文件错误");
Console.ReadLine();
return;
}
AppNoSugarNet.OnUpdateStatus += OnUpdateStatus;
2024-01-23 17:06:47 +08:00
AppNoSugarNet.Init(Config.ServerIP, Config.ServerPort);
2024-01-22 15:08:43 +08:00
while (true)
{
Console.ReadLine();
}
2024-01-22 11:58:24 +08:00
}
static void OnUpdateStatus(long resultReciveAllLenght, long resultSendAllLenght)
{
Console.Title = $"{Title} Recive:{resultReciveAllLenght} Send:{resultSendAllLenght}";
Console.WriteLine($"{Title} Recive:{resultReciveAllLenght} Send:{resultSendAllLenght}");
}
2024-01-22 11:58:24 +08:00
}
2024-01-22 11:58:24 +08:00
}