Capture API / Tool Platform Information - Windows Error Reporting Equivalent

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

  • Operating system information: version, service pack, etc.
  • .NET Details: Framework Version
  • Installed programs
  • Processes executed during the crash.
  • Something I am missing, but should be here.

Is there a tool or set of APIs that allows me to get all of this? What I would like to do is call the API (when it fails), grab all the details and let the user tell me about it. Something like Windows Error Reporting Service.

PS: Right now I can't register for the Windows Error Messaging service itself .

+1


a source to share


1 answer


1) System.OperatingSystem osInfo = System.Environment.OSVersion;

2) http://geekswithblogs.net/lorint/archive/2006/01/30/67654.aspx

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);
}

      

+2


a source







All Articles