コード例 #1
0
ファイル: Server.cs プロジェクト: m916423330/WPF-
    public Server(string ip, int port, 实体类 userInfo)
    {
        _userInfo = userInfo;
        IPAddress localAddr = IPAddress.Parse(ip);

        server = new TcpListener(localAddr, port);
        server.Start();
        StartListener();
    }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>

        public 实体ViewModel()
        {
            UserInfo = new 实体类();

            //下拉框的初始数据
            CombboxList = new List <ComplexInfoModel>()
            {
                new ComplexInfoModel()
                {
                    Key = "1", Text = "苹果"
                },
                new ComplexInfoModel()
                {
                    Key = "2", Text = "香蕉"
                }
            };
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>

        public 实体ViewModel()
        {
            UserInfo = new 实体类();

            //下拉框的初始数据
            CombboxList = new List <ComplexInfoModel>()
            {
                new ComplexInfoModel()
                {
                    Key = "1", Text = "苹果"
                },
                new ComplexInfoModel()
                {
                    Key = "2", Text = "香蕉"
                }
            };


            Thread t = new Thread(delegate()
            {
                // replace the IP with your system IP Address...
                Server myserver = new Server("127.0.0.1", 13000, UserInfo);
            });

            t.Start();

            Console.WriteLine("Server Started...!");
            Client tcp通讯 = new Client(UserInfo);

            LoadTcpClient = new RelayCommand(CQCQCQ);


            Thread t2 = new Thread(async delegate()
            {
                // replace the IP with your system IP Address...
                Websocket myserver = new Websocket();
                await myserver.Server();
            });

            t2.Start();
        }
コード例 #4
0
ファイル: Client.cs プロジェクト: m916423330/WPF-
        public Client(实体类 userInfo)
        {
            _userInfo = userInfo;

            //Console.ReadLine();
        }