<!--Page language="c#" Codebehind="WebForm5.aspx.cs" AutoEventWireup="false" Inherits="Cry18.WebForm5"--> <script language="javascript" type="text/javascript">
function getUserLst(){
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.open("POST", "GetUserAll.aspx",true);
xmlhttp.send("");
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){
var oDoc = new ActiveXObject("MSXML2.DOMDocument");
oDoc.async=true;
oDoc.onreadystatechange=function(){
if(oDoc.readyState==4){
var naItems=oDoc.selectNodes("/TEST/Dhz");
var len=naItems.length;
for(var i=0;i<len;i++){
var row1 = tb.insertRow();
var cell1 = row1.insertCell();
cell1.innerText =oDoc.selectSingleNode("/TEST/Dhz["+i+"]/UID").text+"C";
var cell2 = row1.insertCell();
cell2.innerText = oDoc.selectSingleNode("/TEST/Dhz["+i+"]/UName").text+"C";
}
}
}
var res=oDoc.loadXML(xmlhttp.responseText);
if(res){
alert("加成功经验!");
}else{
alert("装载失败!");
}
}
}
}
function MyShow()
{
var timer =window.setInterval("getUserLst()",5000);
}
</script> <!--CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN--><meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"/><meta content="C#" name="CODE_LANGUAGE"/><meta content="JavaScript" name="vs_defaultClientScript"/><meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"/><script language="javascript" type="text/javascript">
function getUserLst(){
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.open("POST", "GetUserAll.aspx",true);
xmlhttp.send("");
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){
var oDoc = new ActiveXObject("MSXML2.DOMDocument");
oDoc.async=true;
oDoc.onreadystatechange=function(){
if(oDoc.readyState==4){
var naItems=oDoc.selectNodes("/TEST/Dhz");
var len=naItems.length;
for(var i=0;i<len;i++){
var row1 = tb.insertRow();
var cell1 = row1.insertCell();
cell1.innerText =oDoc.selectSingleNode("/TEST/Dhz["+i+"]/UID").text+"C";
var cell2 = row1.insertCell();
cell2.innerText = oDoc.selectSingleNode("/TEST/Dhz["+i+"]/UName").text+"C";
}
}
}
var res=oDoc.loadXML(xmlhttp.responseText);
if(res){
alert("加成功经验!");
}else{
alert("装载失败!");
}
}
}
}
function MyShow()
{
var timer =window.setInterval("getUserLst()",5000);
}
</script><table id="tb" align="center"><tbody><tr><td>UID</td><td>UName</td></tr></tbody></table>
//////////
System.Data.DataSet ds=new System.Data.DataSet("TEST");
System.Data.DataTable dt=new System.Data.DataTable("Dhz");
dt.Columns.AddRange(
new System.Data.DataColumn []{
new System.Data.DataColumn("UID",System.Type.GetType("System.Int32")),
new System.Data.DataColumn("UName",System.Type.GetType("System.String"))
}
);
for(int i=0;i<10;i++)
{
System.Data.DataRow dr=dt.NewRow();
dr[0]=i;
System.Random ra=new Random(i);
dr[1]=ra.Next(1000,9999).ToString ();
dt.Rows.Add(dr);
}
dt.AcceptChanges ();
ds.Tables.Add(dt);
ds.WriteXml(context.Response.OutputStream);
context.Response.Flush();
context.Response.End();