赞
踩
- using System;
- using System.Diagnostics;
- using System.Net;
- using System.Net.Sockets;
- using System.Text;
- using System.Threading;
- private Socket client;
- public bool isConnected = true;
- public bool Open(string ip, string port)
- {
- IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(ip), Convert.ToInt32(port));
- this.client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- this.client.Connect(remoteEP);
- return true;
- }
部分代码如上:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。