我也是在做这功能 主要是用httpclient实现的 要有发短信的端口 主要代码: 要导入三个包commons_codec,httpclient,logging HttpClient client = new HttpClient(); PostMethod post = new PostMethod( "http://cf.lmobile.cn/submitdata/service.asmx/g_Submit"); post.addRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");// 在头文件中设置转码 NameValuePair[] data = { new NameValuePair("sname", "*****"), new NameValuePair("spwd", "*****"), new NameValuePair("scorpid", "*****"), new NameValuePair("sprdid", "*****"), new NameValuePair("sdst", "*****"), new NameValuePair("smsg", "*****") }; post.setRequestBody(data); client.executeMethod(post); Header[] headers = post.getResponseHeaders(); int statusCode = post.getStatusCode(); System.out.println("statusCode:" + statusCode); for (Header h : headers) { System.out.println(h.toString()); } String result = new String(post.getResponseBodyAsString().getBytes( "utf-8")); System.out.println(result); post.releaseConnection();
http://www.139icq.com/你知道飞信 发短线免费撒? 那就OK ,调用吧希望对你有帮助
硬件设备是一个3G网卡
软件方面需要sun提过的java底层通信common包
此外还需要第三方库SMSLib,这个是开源项目,主要用于实现java发短信的功能
我这里有现成的代码,需要的话可以给你一份
我们公司以前用的是 亿美软通 这个公司的,http://www.emay.cn
你找他们想法让他们给你一个序列号,自己下载他们的接口文档看看。
要有什么不懂的找我。感觉自己像做广告似的。
本人做过这样的程序
硬件设备是一个3G网卡
软件方面需要sun提过的java底层通信common包
此外还需要第三方库SMSLib,这个是开源项目,主要用于实现java发短信的功能
我这里有现成的代码,需要的话可以给你一份谢谢18楼分享,能否发到十分感谢
要导入三个包commons_codec,httpclient,logging
HttpClient client = new HttpClient();
PostMethod post = new PostMethod(
"http://cf.lmobile.cn/submitdata/service.asmx/g_Submit");
post.addRequestHeader("Content-Type",
"application/x-www-form-urlencoded;charset=utf-8");// 在头文件中设置转码
NameValuePair[] data = { new NameValuePair("sname", "*****"),
new NameValuePair("spwd", "*****"),
new NameValuePair("scorpid", "*****"),
new NameValuePair("sprdid", "*****"),
new NameValuePair("sdst", "*****"),
new NameValuePair("smsg", "*****") };
post.setRequestBody(data); client.executeMethod(post);
Header[] headers = post.getResponseHeaders();
int statusCode = post.getStatusCode();
System.out.println("statusCode:" + statusCode);
for (Header h : headers) {
System.out.println(h.toString());
}
String result = new String(post.getResponseBodyAsString().getBytes(
"utf-8"));
System.out.println(result);
post.releaseConnection();