您的位置:首页 > 其它

发现个有趣的东西

2011-07-18 18:00 134 查看

发现个有趣的东西

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同学的手机测试,于是段性爆掉了他的手机,罪过罪过啊。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: