Get CPU, RAM and GPU information - UWP App

筅森魡賤 提交于 2019-12-10 15:28:49

问题


Is possible get the information of the CPU, GPU and RAM of a computer, in a UWP app? E show this information in a textblock.

I want to know the processor model (for example: Intel Core i7 xxxx), and total RAM


回答1:


I want to know the processor model (for example: Intel Core i7 xxxx), and total RAM

If in this case, UWP app cannot meet your demands. In UWP you can not get the system CPU , GPU and RAM information since it is sandbox.

For RAM, UWP can only access to information on current app's memory usage by using the MemoryManager class as the comment mentioned.

For GPU information, currently there is no API can access GPU directly in UWP app. You may need to create a UWP app with DirectX and access the information by DirectX. You may find some relative samples here.

Since Win32 could do this, as a suggestion, you could try to use Desktop Bridge to convert the Win32 desktop app to UWP. For how to get these information in Win32 you could reference this.




回答2:


You're going to need to use [DllImport("kernal32")] for the full info. This question has the implementation you need. This question answers how to get the RAM usage and CPU usage much easier.




回答3:


I’m not sur you can get this information in UWP. UWP work like a sand box application.

Maybe you can read this article https://www.suchan.cz/2015/08/uwp-quick-tip-getting-device-os-and-app-info/



来源:https://stackoverflow.com/questions/48194014/get-cpu-ram-and-gpu-information-uwp-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!