Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » 技术文章库  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 [转贴]JAVA 网络编程:手机短信发送程序
suntrees





发贴: 45
积分: 0
于 2003-10-17 20:04 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
JAVA 网络编程:手机短信发送程序
import java.io.*;

import java.net.*;

public class SendMsg {

public static void main(String[] args) {

String query = "sname="+URLEncoder.encode("china");//发送人名称

query +="&msg="+URLEncoder.encode("Message"); //短信内容

query +="&mob1="+URLEncoder.encode("13800000000"); //手机号码1

query +="&mob2=13900000000"; //手机号码2

query +="&login=1"; //登陆方式

query +="&user=13600000000&passwd=123456"; //用户名和密码

try {

//URL u = new URL("http://sms.sina.com.cn/cgi-bin/sms/send.cgi?" + query);

URL u = new URL("http://sms.sina.com.cn/cgi-bin/sms/send.cgi");

URLConnection uc = u.openConnection();

uc.setDoInput(false);

uc.setDoOutput(true);

OutputStreamWriter out = new OutputStreamWriter(uc.getOutputStream());

out.write(query);

out.flush();

out.close();

}

catch (MalformedURLException e) {

System.err.printlnEnvelope;

}

catch (IOException e) {

System.err.printlnEnvelope;

}

}

}



作者 Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re:suntrees]
haoren88435690



发贴: 0
积分: 0
于 2003-11-25 10:36 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
不会这么简单吧


作者 Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re:suntrees]
genius



发贴: 0
积分: 0
于 2003-11-25 10:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我也觉得能这么简单吗?


作者 Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re:suntrees]
nsd





发贴: 48
积分: 10
于 2003-11-25 18:50 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
你没看它是利用新浪的短信网站来发的吗,就是送了一个http请求而已。
拿个浏览器也能发出去。



作者 Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re:suntrees]
jfml





发贴: 708
积分: 30
于 2003-11-26 15:03 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
挂羊头卖狗肉么,靠



flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923