Topic: [转贴]JAVA 网络编程:手机短信发送程序

  Print this page

1.[转贴]JAVA 网络编程:手机短信发送程序 Copy to clipboard
Posted by: suntrees
Posted on: 2003-10-17 20:04

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;

}

}

}

2.Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re: suntrees] Copy to clipboard
Posted by: haoren88435690
Posted on: 2003-11-25 10:36

不会这么简单吧

3.Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re: suntrees] Copy to clipboard
Posted by: genius
Posted on: 2003-11-25 10:46

我也觉得能这么简单吗?

4.Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re: suntrees] Copy to clipboard
Posted by: nsd
Posted on: 2003-11-25 18:50

你没看它是利用新浪的短信网站来发的吗,就是送了一个http请求而已。
拿个浏览器也能发出去。

5.Re:[转贴]JAVA 网络编程:手机短信发送程序 [Re: suntrees] Copy to clipboard
Posted by: jfml
Posted on: 2003-11-26 15:03

挂羊头卖狗肉么,靠


   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