欢迎来到 - 价值文章网 !    
当前位置: 首页 > 短信 >

中正云通信

时间:2020-03-01 00:24 点击:
Function Post(url,data)dim Httpsset Https=server.createobject("MSXML2.XMLHTTP")Https.open "POST",url,falseHttps.setRequestHeader "Content-Type","application/x-www-form-urlencoded"Https.send dataif Https.readystate=4 thendim objstreamset

Function Post(url,data) dim Https set Https=server.createobject("MSXML2.XMLHTTP") Https.open "POST",url,false Https.setRequestHeader "Content-Type","application/x-www-form-urlencoded" Https.send data if Https.readystate=4 then dim objstream set objstream = Server.CreateObject("adodb.stream") objstream.Type = 1 objstream.Mode =3 objstream.Open objstream.Write Https.responseBody objstream.Position = 0 objstream.Type = 2 objstream.Charset = "gb2312" Post = objstream.ReadText objstream.Close set objstream = nothing set https=nothing end if End Function dim target,post_data userName = "帐号" PassWord = "密码" Mobile = "15574888434" Content = "您好,您的验证码是884192【中正通信】" target = "http://service.winic.org:8009/sys_port/gateway/index.asp?" post_data = "id="&userName&"&pwd="&PassWord&"&to="&Mobile&"&content="&Server.URLEncode(Content)&"&time=" response.Write(Post(target,post_data))

$randStr = str_shuffle('1234567890'); $code = substr($randStr,0,4); $content = "你的验证码是:".$code."【中正通信】"; $mobile = "手机号码"; function NewSms($mobile,$content){ $url="http://service.winic.org:8009/sys_port/gateway/index.asp?"; $data = "id=%s&pwd=%s&to=%s&Content=%s&time="; $id = urlencode(iconv("utf-8","gb2312","帐号")); $pwd = '密码'; $to = $mobile; $content = urlencode(iconv("UTF-8","GB2312",$content)); $rdata = sprintf($data, $id, $pwd, $to, $content); $ch = curl_init(); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$rdata); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); curl_close($ch); return $result; } echo NewSms($mobile,$content);

private void button1_Click_1(object sender, EventArgs e) { string uid = t_uid.Text.Trim(); string pwd = t_pwd.Text.Trim(); string mob = t_mob.Text.Trim(); string msg = t_msg.Text.Trim(); string backinfo = PostData("http://service.winic.org:8009/sys_port/gateway/index.asp?", "id=" + uid + "&pwd=" + pwd + "&to=" + mob + "&content=" + msg + "&time="); vtag.Text = backinfo; } public static string PostData(string purl,string str){ try{ byte[] data = System.Text.Encoding.GetEncoding("GB2312").GetBytes(str); // 准备请求 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(purl); //设置超时 req.Timeout = 30000; req.Method = "Post"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = data.Length; Stream stream = req.GetRequestStream(); // 发送数据 stream.Write(data, 0, data.Length); stream.Close(); HttpWebResponse rep = (HttpWebResponse)req.GetResponse(); Stream receiveStream = rep.GetResponseStream(); Encoding encode = System.Text.Encoding.GetEncoding("UTF-8"); // Pipes the stream to a higher level stream reader with the required encoding format. StreamReader readStream = new StreamReader(receiveStream, encode); Char[] read = new Char[256]; int count = readStream.Read(read, 0, 256); StringBuilder sb = new StringBuilder(""); while (count > 0) { String readstr = new String(read, 0, count); sb.Append(readstr); count = readStream.Read(read, 0, 256); } rep.Close(); readStream.Close(); return sb.ToString(); } catch (Exception ex) { return "posterror"; } } string backinfo=PostData("http://service.winic.org:8009/sys_port/gateway/index.asp?","id=" + uid + "&pwd=" + pwd + "&to=" + to + "&content=" + content + "&time="); string uid = "帐号"; string pwd = "密码"; string to = "手机号"; string content = "您好,您的验证码是884192【中正云通信】";

public static String HTTP_POST(String URL, String Data) throws Exception { BufferedReader In = null; PrintWriter Out = null; HttpURLConnection HttpConn = null; try { URL url=new URL(URL); HttpConn=(HttpURLConnection)url.openConnection(); HttpConn.setRequestMethod("POST"); HttpConn.setDoInput(true); HttpConn.setDoOutput(true); Out=new PrintWriter(HttpConn.getOutputStream()); Out.println(Data); Out.flush(); if(HttpConn.getResponseCode() == HttpURLConnection.HTTP_OK){ StringBuffer content = new StringBuffer(); String tempStr = ""; In = new BufferedReader(new InputStreamReader(HttpConn.getInputStream())); while((tempStr = In.readLine()) != null){ content.append(tempStr); } In.close(); return content.toString(); } else { throw new Exception("HTTP_POST_ERROR_RETURN_STATUS:" + HttpConn.getResponseCode()); } } catch (IOException e) { e.printStackTrace(); }finally{ Out.close(); HttpConn.disconnect(); } return null; } public static void main(String[] args) throws Exception{ String HTTP_BACK_MESSAGE = ""; HTTP_BACK_MESSAGE = HTTP_POST("http://service.winic.org/sys_port/gateway/index.asp", "id=帐号&pwd=密码&to=手机号码&content=" + URLEncoder.encode("您好,您的验证码是884192【中正云通信】", "gb2312") + "&time="); System.out.println(HTTP_BACK_MESSAGE); }

string ls_result integer li_rc inet linet_main n_cst_internet luo_data linet_main = CREATE inet luo_data = CREATE n_cst_internet SetPointer(HourGlass!) li_rc = linet_main.GetURL("http://service.winic.org:8009/sys_port/gateway/index.asp?id=帐号&pwd=密码&to=手机&content=您好,您的验证码是884192【中正云通信】&time=", luo_data) SetPointer(Arrow!) ls_result = luo_data.is_data Messagebox("",ls_result) DESTROY luo_data DESTROY linet_main return ls_result

数据统计中,请稍等!
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------