Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I am working on a project in which I have to read the size on 'Memory Dumps' and also remove these. I tried to get the path from registries but it giving error of "File not found" , in this thing I need your help. Is there any method to detect 'Memory Dumps' and remove those 'Memory Dumps'. If there is any way then please help me.

This is the code snippet which I tried
C#
RegistryKey dump = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\CrashControl");
            string MiniDump=Path.GetFileName( Path.GetFullPath(dump.GetValue("MinidumpDir").ToString()));
            string mini = Path.GetFileName(Path.GetFileName(Path.GetFullPath(dump.GetValue("MinidumpDir").ToString())));
            string DumpFile = Path.GetFileName(Path.GetFullPath(dump.GetValue("DumpFile").ToString()));
            FileInfo fd = new FileInfo(Path.GetFileName(Path.GetFullPath(dump.GetValue("MinidumpDir").ToString())));

Thank you.
Posted
Updated 14-Feb-14 2:23am
v3
Comments
OriginalGriff 14-Feb-14 5:08am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
Richard MacCutchan 14-Feb-14 11:59am    
OK, so you have added your code, but you still have not expalined what happens when you run it. Presumably you want to get a list of files from that directory and delete them, so I would suggest you try http://msdn.microsoft.com/en-us/library/07wt70x2(v=vs.110).aspx. I would also strongly advise you to add code to check the results of your library calls to check whether you get valid response or not. alternatively use trycatch blocks.

1 solution

 
Share this answer
 
Comments
AdityaBohra 14-Feb-14 7:14am    
Thanks Richard, but I have already seen it and it is not so useful for me.
Richard MacCutchan 14-Feb-14 7:50am    
Well your question lacked any useful detail to give a better answer. If you want technical help then you need to be very specific and detailed about your problem. It is no good saying but it giving error of "File not found", since you have not shown the code that produces this error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900