Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Reading path of small dump file(windows dump) through code

0.00/5 (No votes)
23 Nov 2010 1  
This explains how to read the path of windows dump file in your c# code.

This code works on windows XP as well as windows 7. Even if the dump path has been modified, we will get the modified one.

This needs only basic knowledge of registry. Using RegistryKey class of Win32, we will read the key and the value associate with it as below:


=========================================================================
private string GetMiniDumpFilePath()
        {
            RegistryKey key = Registry.LocalMachine;
            if (key != null)
            {
                RegistryKey sub = key.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\CrashControl");
                if (sub != null)
                {
                    object obj = sub.GetValue("MinidumpDir", null, RegistryValueOptions.None);
                    if (obj != null)
                    {
                        return Convert.ToString(obj);
                    }
                }
            }
        }

========================================================================

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here