在控制台应用程序中获取RAM大小 [英] Get RAM size in Console Application

查看:89
本文介绍了在控制台应用程序中获取RAM大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我必须得到控制台应用程序中的总大小等内存信息。 GlobalMemoryStatusEx函数可用于执行此操作,但它仅适用于msdn的桌面应用程序。当我在控制台应用程序中使用此功能时,会发生太多错误。有没有办法让ram大小?请帮我。谢谢。

Hello my friends,
I have to get memory information like total size in console application. GlobalMemoryStatusEx function can be used for doing this, but it is applied only to desktop apps by msdn. When I use this function in console application, too many errors occurs. Is there any way to get ram size? Please help me. Thanks.

推荐答案

GlobalMemoryStatusEx()可用于控制台应用程序。当MSDN仅指示桌面功能时,这意味着它不适用于Metro /移动应用程序。



如果您遇到错误,请检查您的代码。一个常见的错误是忘记设置传递结构的size成员( dwLength MEMORYSTATUSEX )。
GlobalMemoryStatusEx() can be used with console applications. When the MSDN indicates a function for desktop only this means that it is not available for Metro/mobile apps.

If you got errors you should check your code. A common error is forgetting to set the size member of the passed structure (dwLength with MEMORYSTATUSEX).


这篇关于在控制台应用程序中获取RAM大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆