public void LaunchServer() { try { NetworkSystem.LaunchServer(); NetworkSystem.server.TurnOnTCP(); NetworkSystem.ConnectTo(NetworkSystem.LocalIPAddress); } catch (SocketException ex) { if (ex.SocketErrorCode == SocketError.AddressAlreadyInUse) { NetworkSystem.ShutdownServer(); NotificationSystem.ShowNotification("相同地址已经存在一个服务器"); } } }