捕获 API/工具的平台详细信息 - Windows 错误报告等效项

发布于 2024-07-20 04:21:48 字数 456 浏览 1 评论 0原文

我正在开发一个用 C# 编写的基于 .NET 的桌面应用程序。 如果应用程序崩溃,我想捕获有关运行应用程序的计算机的某些详细信息:

  1. 操作系统详细信息:版本、服务包等
  2. .NET 详细信息:框架版本
  3. 安装的程序
  4. 崩溃时运行的进程。
  5. 有些东西我错过了,但应该在这里。

有没有一个工具或 API 集可以让我方便地获得这一切? 我想做的是调用 API(当崩溃发生时),捕获所有详细信息,并让用户能够将其报告给我。 类似于 Windows 错误报告服务。

PS:目前,我无法注册 Windows 错误报告服务< /a> 本身。

I am developing a .NET based desktop application written in C#. If and when the application crashes, I would like to capture certain details regarding the machine on which the application was running:

  1. Operating system details: version, service pack etc.
  2. .NET details: Framework version
  3. Installed programs
  4. Processes running at the time of the crash.
  5. Somethings which I'm missing, but should be here.

Is there a tool or an API set which lets me get all this conveniently? What I would like to do is to invoke the API (when the crash occurs), capture all the details, and let the user be able to report it back to me. Something like the windows error reporting service.

P.S: Right now, I can't sign up for the Windows Error Reporting service itself.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北风几吹夏 2024-07-27 04:21:48
  1. System.OperatingSystem osInfo=System.Environment.OSVersion;

  2. 链接

  3.  stringregistryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"; 
      
        using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey)) 
        { 
            var query = from a in 
                            key.GetSubKeyNames() 
                        let r = key.OpenSubKey(a) 
                        select new 
                        { 
                            Application = r.GetValue("DisplayName") 
                        };
            
            foreach (var item in query) 
            { 
                if (item.Application != null)
                    Console.WriteLine(item.Application); 
            }
        }

(通过 http://www .onedotnetway.com/get-a-list-of-installed-applications-using-linq-and-c/)

4)

Process[] processlist = Process.GetProcesses();

foreach(Process theprocess in processlist)
{
    Console.WriteLine("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id);
}
  1. System.OperatingSystem osInfo=System.Environment.OSVersion;

  2. Link

  3.      string registryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
    
        using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey)) 
        { 
            var query = from a in 
                            key.GetSubKeyNames() 
                        let r = key.OpenSubKey(a) 
                        select new 
                        { 
                            Application = r.GetValue("DisplayName") 
                        };
            
            foreach (var item in query) 
            { 
                if (item.Application != null)
                    Console.WriteLine(item.Application); 
            }
        }

(via http://www.onedotnetway.com/get-a-list-of-installed-applications-using-linq-and-c/)

4)

Process[] processlist = Process.GetProcesses();

foreach(Process theprocess in processlist)
{
    Console.WriteLine("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文