发现个有趣的东西

发现个有趣的东西

 

http://sms.api.bz/fetion.php?username=您的移动飞信登录手机号&password=您的移动飞信登录密码&sendto=接收短信的飞信好友手机号&message=短信内容

通过上面这个URL提交就可以发短信了

例如:http://sms.api.bz/fetion.php?username=13800138000&password=123456&sendto=13912345678&message=短信内容

 

于是写了个无聊的代码(解决刚才的乱码问题):

import java.io.IOException;

import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import org.apache.commons.httpclient.params.HttpMethodParams;

 

class fection
{
 static public void main(String []args) throws IOException
 {
  int i = 0;
  while(i<3)//做人要厚道
  {
         String PostURL=("
http://sms.api.bz/fetion.php?username=&password=&sendto=&message=");
            HttpClient client = new HttpClient();
            PostMethod postMethod =  new PostMethod(PostURL);
            postMethod.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"GBK");//发送中文,避免乱码
            postMethod.addParameter("username","135********");
            postMethod.addParameter("password","mypassword");
            postMethod.addParameter("sendto","136********");//立方
            postMethod.addParameter("message","哈哈,可以发中文了,共3条,这是第"+Integer.toString(i+1)+"条");
            client.setConnectionTimeout(10000);
            client.executeMethod(postMethod);
            i++;
  }
        System.out.println("OK!");
 }


}

 

HttpClient竟然要用那么多包,把我搞得晕晕的。。。

 

while(i<3)这个循环开始忘写i++了,于是是一个死循环,用xx同学的手机测试,于是段性爆掉了他的手机,罪过罪过啊。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值