图书馆是获取和QUOT;关键"机调试信息的目的是什么?目的、图书馆、关键、信息

由网友(抛开世俗 ,)分享简介:关键设备信息将被记录,并应用于调试,一旦我们的软件是在外地。The "critical" machine information will be logged and shall be used for debugging purposes once our software is in the field.关键的...

关键设备信息将被记录,并应用于调试,一旦我们的软件是在外地。

The "critical" machine information will be logged and shall be used for debugging purposes once our software is in the field.

关键的信息可能包含数据是一般重要的调试应用程序。它可以包括:

"Critical" information may include data that is "generally" important for debugging the application. It may include:

操作系统 在Windows更新安装 硬件信息:CPU,内存,硬盘 进程/服务运行 在当前用户帐户

我很抱歉问这样含糊不清的问题,我认为这是相当琐碎写一个自定义使用WMI。但是,如果有已经被专门做这种东西的库/框架,这将是巨大的,不推倒重来。

I'm sorry for asking such vague question and I believe that it's fairly trivial to write a custom one using WMI. But, if there's already a library/framework that is designed to do this kind of stuff, it would be great to not reinvent the wheel.

推荐答案

尝试这样的事情, 伪code!的

Try something like this, pseudocode!

        private StringBuilder GetSystemInformationString()
        {
            StringBuilder sb = new StringBuilder();
            PropertyInfo[] properties = typeof(System.Windows.Forms.SystemInformation).GetProperties();
            if (properties != null && properties.Length > 0)
            {
                foreach (PropertyInfo pin in properties)
                {
                    sb.Append(System.Environment.NewLine);
                    sb.Append(pin.Name + " : " + pin.GetValue(pin, null));
                }
            }

            return sb;

        }

内存可以使用这样的:

for memory can use something like this :

(System.Diagnostics.Process.GetCurrentProcess().WorkingSet64 / 1024).ToString() + " Kb";

问候。

阅读全文

相关推荐

最新文章