首页 技术 正文
技术 2022年11月19日
0 收藏 513 点赞 2,897 浏览 3017 个字

接口一:

1:QQ群信息统计 地址:http://localhost:8080/webServices/messageSort

注意:连接地址提交的是一个txt文件,返回是一个list的json字符串,解释json字符串网上例子很多,请自行解释。

2:接口实例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>知识网</title>
<script src="/uploadify/jquery_1_7_2_min.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript" src="/uploadify/jquery.uploadify.min.js"></script>
<link type="text/css" href="/uploadify/uploadify.css" rel="external nofollow" rel="stylesheet" />
<link id="artDialogSkin" href="/artDialog4.1.7/skins/red.css" rel="external nofollow" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/artDialog4.1.7/artDialog.js"></script>
<script type="text/javascript" src="/uploadify/jquery.form.js"></script>
<script type="text/javascript">
var myDialog;
//uploadify控件
$(function() {
$("#filePath").uploadify(
{
swf : '/uploadify/uploadify.swf',
uploader : 'http://localhost:8080/webServices/messageSort',
buttonText : '提交文件',
fileSizeLimit : '20MB',
height : 22,
fileTypeDesc : '不超过20M的文件(*.txt)',
fileTypeExts : '*.txt',
multi : false,
width : 90,
onUploadError : function(file, errorCode, errorMsg,
errorString) {
art.dialog({
icon : 'error',
content : errorString
});
},
onUploadStart : function(file) {
$(".aui_content").css({
"width" : "100%",
"height" : "100%"
});
myDialog = art.dialog();// 初始化一个带有loading图标的空对话框
},
onUploadSuccess : function(file, data, response) {
$(".aui_content").css({
"width" : "400px",
"height" : "500px",
"overflow" : "auto"
});
var info = "<table width=\"100%\"><tr><td>群成员</td><td align=\"center\">QQ号</td><td align=\"center\">描述内容</td><td align=\"center\">信息条数</td></tr>";
var dataObj = eval(data);//
for ( var index in dataObj) {
info += "<tr><td>" + dataObj[index].name
+ "</td><td align=\"center\">"
+ dataObj[index].qq
+ "</td><td align=\"center\">"
+ dataObj[index].mark
+ "</td><td align=\"center\">"
+ dataObj[index].count
+ "</td><tr>";
}
info += "</table>";
myDialog.content(info);// 填充对话框内容
}
});
});
//jquery.from.js控件
function upload2() {
myDialog = art.dialog();// 初始化一个带有loading图标的空对话框
var options = {
url : "http://localhost:8080/webServices/messageSort",
type : "POST",
//dataType : "json",
success : function(data) {
var info = "<table width=\"100%\"><tr><td>群成员</td><td align=\"center\">QQ号</td><td align=\"center\">描述内容</td><td align=\"center\">信息条数</td></tr>";
var dataObj=eval(data);//
for ( var index in dataObj) {
info += "<tr><td>" + dataObj[index].name
+ "</td><td align=\"center\">" + dataObj[index].qq
+ "</td><td align=\"center\">"
+ dataObj[index].mark
+ "</td><td align=\"center\">"
+ dataObj[index].count + "</td><tr>";
}
info += "</table>";
myDialog.content(info);// 填充对话框内容
}
};
$("#proAdd").ajaxSubmit(options);
}
</script>
</head>
<body><div class="webcontent">
接口一: <br />1:QQ群信息统计 地址:http://localhost:8080/webServiceTest/webServices/messageSort
<br/>
<br/>
在线统计QQ群信息:
<table>
<tr>
<td>文件提交方式1:uploadify控件</td>
<td><input type="file" id="filePath" name="filePath" multiple="true" /></td>
</tr>
<tr>
<td>文件提交方式2:jquery.from.js控件</td>
<td>
<form id="proAdd" name="proAdd" method="post" enctype="multipart/form-data">
<input type="file" id="filePath" name="filePath" multiple="true" onchange="upload2();"/>
</form>
</td>
</tr>
</table>
</div></body>
</html>

QQ群信息统计

QQ群信息统计

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,078
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,553
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,402
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,177
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,814
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898