7 years C/C++/C# programing, focus on embedded and mobile device development.
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
::
72 随笔 :: 1 文章 :: 132 评论 :: 5 引用
Windows mobile 中获取内存使用情况
Code
using
System;
using
System.Text;
using
System.Runtime.InteropServices;
namespace
TaskManager
{
public
class
Memory
{
static
MEMORYSTATUS status
=
new
MEMORYSTATUS();
P/V invoke
#region
P/V invoke
private
struct
MEMORYSTATUS
{
public
UInt32 dwLength;
public
UInt32 dwMemoryLoad;
public
UInt32 dwTotalPhys;
public
UInt32 dwAvailPhys;
public
UInt32 dwTotalPageFile;
public
UInt32 dwAvailPageFile;
public
UInt32 dwTotalVirtual;
public
UInt32 dwAvailVirtual;
}
[DllImport(
"
CoreDll.dll
"
)]
private
static
extern
void
GlobalMemoryStatus
(
ref
MEMORYSTATUS lpBuffer
);
[DllImport(
"
CoreDll.dll
"
)]
private
static
extern
int
GetSystemMemoryDivision
(
ref
UInt32 lpdwStorePages,
ref
UInt32 lpdwRamPages,
ref
UInt32 lpdwPageSize
);
#endregion
public
static
void
UpdateStatus()
{
GlobalMemoryStatus(
ref
status);
}
public
static
UInt32 TotalPhysicalMemory
{
get
{
return
status.dwTotalPhys;
}
}
public
static
UInt32 AvilablePhysicalMemory
{
get
{
return
status.dwAvailPhys;
}
}
public
static
UInt32 TotalVirtualMemory
{
get
{
return
status.dwTotalVirtual;
}
}
public
static
UInt32 AvilableVirtualMemory
{
get
{
return
status.dwAvailVirtual;
}
}
public
static
UInt32 TotalPageFile
{
get
{
return
status.dwTotalPageFile;
}
}
public
static
UInt32 AvilablePageFile
{
get
{
return
status.dwAvailPageFile;
}
}
}
}
标签:
windows mobile
绿色通道:
好文要顶
关注我
收藏该文
与我联系
posted on 2009-09-24 16:44
woaiusd
阅读(269)
评论(1)
编辑
收藏
评论
1657975
#1楼
2009-09-25 15:15
Jack Fan
恩,不错,其实如果加点注释,那么调用起来就更明确了。
回复
引用
查看
注册用户登录后才能发表评论,请
登录
或
注册
,
返回博客园首页
。
首页
博问
闪存
新闻
园子
招聘
知识库
最新IT新闻
:
·
最想要的Entity Framework功能
·
专访Jeffrey Richter:Windows 8是微软的重中之重
·
《福布斯》:谷歌进军硬件产品 难撼动苹果地位
·
美国空军拟最多购买1.8万台iPad 2
·
分析称专利之争让谷歌苹果两败俱伤
»
更多新闻...
最新知识库文章
:
·
高级编程语言的发展历程
·
如何学习一门新的编程语言?
·
学习不同编程语言的重要性
·
为什么我喜欢富于表达性的编程语言
·
计算机专业的女生为什么要学编程
»
更多知识库文章...
China-pub 2011秋季教材巡展
China-Pub 计算机绝版图书按需印刷服务
<
2009年9月
>
日
一
二
三
四
五
六
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
6
7
8
9
10
公告
昵称:
woaiusd
园龄:
5年3个月
粉丝:
1
关注:
0
搜索
常用链接
我的随笔
我的评论
我的参与
最新评论
我的标签
最新随笔
1. MAC OS中的dylib 的@rpath和@loader_path小问题
2. 有几个人知道C语言中int8_t, uint8_t, time_t ... 等等数据类型中的_t是什么意思
3. 无线路由器总是提示输入的密码错误
4. I2C中的重复起始条件到底是什么意思
5. release, retain, autorelease 与 AT, MT, AMT
6. 有关 stringWithString 和 initWithString
7. lpc1343 usb isp not work in linux and mac
8. C#平台互操作部署问题
9. C++Builder中的异常传递
10. Windows mobile 中获取内存使用情况
我的标签
m3
(1)
windows7
(1)
paint
(1)
玩玩Hiweed linux 2.0
(1)
玩玩edubuntu 8.10
(1)
kubuntu
(1)
淘宝
(1)
taobao
(1)
api
(1)
淘宝API
(1)
更多
随笔分类
.Net
(rss)
Linux(4)
(rss)
Office使用及开发(4)
(rss)
嵌入式设备(5)
(rss)
射频识别(2)
(rss)
移动设备(26)
(rss)
资料查阅(8)
(rss)
随笔档案
2011年8月 (1)
2011年6月 (1)
2011年4月 (2)
2011年3月 (2)
2010年12月 (2)
2010年3月 (1)
2009年9月 (1)
2009年7月 (2)
2008年11月 (5)
2008年9月 (4)
2008年8月 (2)
2008年2月 (1)
2008年1月 (3)
2007年9月 (1)
2007年8月 (4)
2007年5月 (1)
2007年4月 (1)
2007年3月 (6)
2007年2月 (2)
2007年1月 (3)
2006年12月 (9)
2006年11月 (18)
友情链接
swnuwangyun
我在CSDN上的老窝
yutian
我们寝室的室长,大牛!
最新评论
评论排行榜