コード例 #1
0
 /// <summary>
 /// 显示菜单
 /// </summary>
 public void ShowMenu()
 {
     if (_p2pService.Start())
     {
         while (true)
         {
             Thread.Sleep(500);
             Logger.Console.WriteLine("请输入远程服务名称:");
             string remoteServerName = Console.ReadLine();
             if (!_p2pService.SetRemoteServerName(remoteServerName))
             {
                 Logger.Error.WriteLine("远程服务-服务不可用!");
             }
             Console.ReadKey();
         }
     }
     else
     {
         Logger.Console.WriteLine("任意键退出...");
         Console.ReadKey();
     }
 }
コード例 #2
0
        static void Main(string[] args)
        {
            P2PService p2PService = new P2PService();

            p2PService.Start();
        }