日期:2014-05-17 浏览次数:20454 次
using (Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
{
client.Connect(IPAddress.Parse("192.168.1.7"), 80);//IP自己填
string content = "";//Send字符串自己按照规则拼接
client.Send(Encoding.Default.GetBytes(content));
byte[] bytes = new byte[1000];
client.Receive(bytes);
string recv = Encoding.Default.GetString(bytes);//这里是接收到的内容
//下面干你的活去吧
}