Ajax(一)显示可用内存空间
打開VS,新建空網(wǎng)站,添加新項命名為Receive.aspx<br>
在后臺的內(nèi)容為:
?protected void Page_Load(object sender, EventArgs e)
??? {
??????? PerformanceCounter myMeroy = new PerformanceCounter();
??????? myMeroy.CategoryName = "Memory";
??????? myMeroy.CounterName = "Available KBytes";
??????? string txtRelust = "-->可用的內(nèi)存:" + myMeroy.NextValue().ToString() + "KB";
??????? Response.Write(DateTime.Now.ToLongTimeString()+"?? "+ txtRelust);
??? }
添加一個htm文件,命名為client.htm
?<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('div1').innerHTML = XmlHttp.responsetext;
???????????? }
?這樣就會出現(xiàn)一個不斷變化的內(nèi)存空間
轉(zhuǎn)載于:https://www.cnblogs.com/xuxiaorong/archive/2012/03/27/2420324.html
總結(jié)
以上是生活随笔為你收集整理的Ajax(一)显示可用内存空间的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 农村电子商务怎么做 以下这些成功经验别错
- 下一篇: 苹果开始招聘6G研发工程师 从事下一代6