图书馆是获取和QUOT;关键"机调试信息的目的是什么? [英] Library that fetches "critical" machine information for debugging purposes?

查看:130
本文介绍了图书馆是获取和QUOT;关键"机调试信息的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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:

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

我很抱歉问这样含糊不清的问题,我认为这是相当琐碎写一个自定义使用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";

问候。

这篇关于图书馆是获取和QUOT;关键"机调试信息的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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