Alex’Sky
博客园
首页
社区
新随笔
联系
订阅
管理
随笔-8 评论-4 文章-4 trackbacks-1
XMLhttp学习应用
Client.htm页面代码如下:
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
>
客户端
</
title
>
<
script
type
="text/javascript"
>
var
XmlHttp
=
new
ActiveXObject(
"
Microsoft.XMLhttp
"
);
function
sendAJAX()
{
XmlHttp.Open(
"
POST
"
,
"
receive.aspx
"
,
true
);
XmlHttp.send(
null
);
XmlHttp.onreadystatechange
=
ServerProcess;
}
function
ServerProcess()
{
if
(XmlHttp.readystate
==
4
||
XmlHttp.readystate
==
'complete')
{
document.getElementById('nameList').innerHTML
=
XmlHttp.responsetext;
}
}
setInterval('sendAJAX()',
1000
);
</
script
>
</
head
>
<
body
>
<
div
id
="nameList"
></
div
>
</
body
>
</
html
>
Receive.aspx CodeBehind代码:
protected
void
Page_Load(
object
sender, EventArgs e)
{
PerformanceCounter myMemory
=
new
PerformanceCounter();
myMemory.CategoryName
=
"
Memory
"
;
myMemory.CounterName
=
"
Available KBytes
"
;
string
txtResult
=
"
-->当前可用内存:
"
+
myMemory.NextValue().ToString()
+
"
KB
"
;
Response.Write(DateTime.Now.ToLongTimeString()
+
txtResult);
}
绿色通道:
好文要顶
关注我
收藏该文
与我联系
posted on 2008-06-09 17:59
Alex’Sky
阅读(117)
评论(0)
编辑
收藏
注册用户登录后才能发表评论,请
登录
或
注册
,
返回博客园首页
。
首页
博问
闪存
新闻
园子
招聘
知识库
最新IT新闻
:
·
谷歌将出售Clearwire股份 不到收购价1/10
·
为什么Google比苹果更令微软恐惧?
·
思科拟2.71亿美元收购私有公司Lightwire
·
社交商务公司Bazaarvoice将于2月24日进行IPO
·
戴尔收购备份软件公司AppAssure
»
更多新闻...
最新知识库文章
:
·
领域模型管理与AOP
·
编程的艺术:漂亮的代码和漂亮的软件
·
GIT分支管理是一门艺术
·
编程:是一门艺术
·
编程是一门艺术吗?
»
更多知识库文章...
China-pub 2011秋季教材巡展
China-Pub 计算机绝版图书按需印刷服务
昵称:
Alex’Sky
园龄:
5年4个月
粉丝:
4
关注:
1
<
2008年6月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
搜索
常用链接
我的随笔
我的评论
我的参与
最新评论
我的标签
随笔分类
.NET设计模式系列 (2)
AJAX(4)
Castle 开发系列
linux学习(2)
Windows Mobile(1)
个人随笔(3)
生活随笔(3)
数据库
随笔档案
2008年6月 (4)
2007年3月 (1)
2006年11月 (8)
2006年10月 (2)
文章分类
JAVA学习(4)
相册
广州生活
A.Web Sites
dotnetspider
GotDotNet
Microsoft Windows Forms
patterns & practices Community
PINVOKE.NET
The Code Project
TheServerSide.NET
vbaccelerator.com
我的好友
黎波(Blogs)
彭斌(ugoer)
闪电
田政
伍华聪
友情博客
freezesoul
Jeffrey Zhao
Lyn Z. Tam(谭振林)
Terrylee
Truly
陈黎夫
飞扬新锐
邝伟科
刘润
吕震宇
朱伟
最新评论
阅读排行榜
评论排行榜
推荐排行榜