zoukankan
html css js c++ java
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;
}
}
}
}
查看全文
相关阅读:
linux学习之linux的hostname修改详解《转》
不想作死系列--win7远程linux桌面之vncserver
不想作死系列---virtualbox最小化安装centos6.5
基于支持向量机的车牌识别-- opencv2.4.7+vs2012环境搭建
python文件的中文处理以及个人思路
haskell学习笔记<1>--基本语法
提醒
C语言矩阵传递给函数的方法
0x01数据结构——C语言实现(二叉查找树)
0x01数据结构——C语言实现(二叉树)
原文地址:https://www.cnblogs.com/swnuwangyun/p/1573425.html
最新文章
Python的安装与设置
NodeJs 基础知识
css 字间距离_css 字体字符间距设置
mongodb 使用
memcached asp.net
asp.net Npoi 使用
提问:错误提示--命名空间“System.Web”中不存在类型或命名空间名称“UI”(是缺少程序集引用吗?) 如何解决??
HTML中Div、span、label标签的区别
Android资源管理框架(Asset Manager)简要介绍和学习计划
软件架构---.net框架介绍
热门文章
MVC学习笔记---WebViewPage(nop等开源项目的@T)
C#学习笔记----静态字段和静态方法
MVC学习笔记----@Helper标签(HelperMethod方法)和HtmlExtesion扩展
架构学习--利用订阅事件完成更新缓存(观察者模式)
.net学习笔记---quartz.net计划任务
架构学习----消息队列
.net学习笔记----HttpRequest,WebRequest,HttpWebRequest区别
SQL学习笔记----Select查询先后顺序
.net学习笔记---tcp/udp/http/socket
python-igraph on windows10 64bit
Copyright © 2011-2022 走看看