public static string WapPush(string Host,int Port,string Data,int Timeout)
{
TcpClient tc = new TcpClient();
tc.Connect(Host, Port);
NetworkStream ns = tc.GetStream();
byte[] bytes = null;
if (ns.CanWrite)
{
int i = 0;
byte[] buffer = System.Text.Encoding.GetEncoding("gb2312").GetBytes(Data);
ns.Write(buffer,0,buffer.Length);
}
return "发送成功 ^_^";
}
example:
WapPush("主机IP","端口号","手机号"+"/t"+"链接url"+"/t"+描述+"/t1/n",5)