• QQ群信息统计


    接口一:

    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="stylesheet" />
    <link id="artDialogSkin" href="/artDialog4.1.7/skins/red.css" 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>












  • 相关阅读:
    Redis使用:聚合类型为空时,会自动被Redis删除
    Effective C++: 04设计与声明
    select引起的服务端程序崩溃问题
    Effective C++: 03资源管理
    Effective C++: 02构造、析构、赋值运算
    Effective C++: 01让自己习惯C++
    Centos7.2 安装配置 Tengine(nginx)
    Centos7更新阿里yum源
    Go中函数作为值、类型传递。
    go实现冒泡排序和快速排序
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3236942.html
Copyright © 2020-2023  润新知