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;

}

}

}




话题树型展开
人气 标题 作者 字数 发贴时间
14302 [转贴]JAVA 网络编程:手机短信发送程序 suntrees 964 2003-10-17 20:04
11764 Re:[转贴]JAVA 网络编程:手机短信发送程序 haoren88435690 7 2003-11-25 10:36
11626 Re:[转贴]JAVA 网络编程:手机短信发送程序 genius 11 2003-11-25 10:46
12051 Re:[转贴]JAVA 网络编程:手机短信发送程序 nsd 47 2003-11-25 18:50
12899 Re:[转贴]JAVA 网络编程:手机短信发送程序 jfml 9 2003-11-26 15:03

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