예제 #1
0
        public static void CreateEmptyConnectionPropities(string path)
        {
            ConnectionPropities connectionPropities = new ConnectionPropities()
            {
                ip = "127.0.0.1", port = 8002
            };
            string json = JsonConvert.SerializeObject(connectionPropities);

            Save(json, path);
            //Console.WriteLine(json);
        }
예제 #2
0
        private TcpClient Connect()
        {
            try
            {
                Propities           propities           = new Propities();
                ConnectionPropities connectionPropities = propities.GetConnect();

                TcpClient tcpClient = new TcpClient();
                tcpClient.Connect(connectionPropities.ip, connectionPropities.port);

                return(tcpClient);
            }
            catch (Exception e)
            {
                //EventArgs eventArgs = new EventArgs();
                //On_Exception.Invoke(e, eventArgs);
                Console.WriteLine(DateTime.Now.ToShortTimeString() + " (CRITYCAL): " + e.Message);
                return(null);
            }
        }