Changeset 1874 for trunk/eraser6/Eraser.Util/BlackBox.cs
- Timestamp:
- 3/1/2010 12:29:44 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/eraser6/Eraser.Util/BlackBox.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Eraser.Util/BlackBox.cs
r1842 r1874 40 40 using System.Net; 41 41 using System.Xml; 42 using System.ComponentModel; 42 43 43 44 namespace Eraser.Util … … 189 190 //Application information 190 191 string separator = new string('-', 76); 191 string lineFormat = "{0,1 5}: {1}";192 string lineFormat = "{0,17}: {1}"; 192 193 stream.WriteLine("Application Information"); 193 194 stream.WriteLine(separator); … … 202 203 stream.WriteLine(string.Format(lineFormat, "Command Line", 203 204 commandLine.ToString().Trim())); 205 stream.WriteLine(string.Format(lineFormat, "Current Directory", 206 Environment.CurrentDirectory)); 207 208 //System Information 209 stream.WriteLine(); 210 stream.WriteLine("System Information"); 211 stream.WriteLine(separator); 212 stream.WriteLine(string.Format(lineFormat, "Operating System", 213 string.Format("{0} {2} {3}{1}", 214 Environment.OSVersion.VersionString, 215 string.IsNullOrEmpty(Environment.OSVersion.ServicePack) ? 216 string.Empty : 217 string.Format("(Service Pack {2})", Environment.OSVersion.ServicePack), 218 SystemInfo.WindowsEdition == WindowsEditions.Undefined ? 219 "" : SystemInfo.WindowsEdition.ToString(), 220 SystemInfo.ProcessorArchitecture))); 221 stream.WriteLine(string.Format(lineFormat, "Processor Count", 222 Environment.ProcessorCount)); 223 224 //Running processes 225 stream.WriteLine(); 226 stream.WriteLine("Running Processes"); 227 stream.WriteLine(separator); 228 { 229 int i = 0; 230 foreach (Process process in Process.GetProcesses()) 231 { 232 try 233 { 234 ProcessModule mainModule = process.MainModule; 235 stream.WriteLine(string.Format(lineFormat, 236 string.Format("Process[{0}]", ++i), 237 string.Format("{0} [{1}.{2}.{3}.{4}{5}]", mainModule.FileName, 238 mainModule.FileVersionInfo.FileMajorPart, 239 mainModule.FileVersionInfo.FileMinorPart, 240 mainModule.FileVersionInfo.FileBuildPart, 241 mainModule.FileVersionInfo.FilePrivatePart, 242 string.IsNullOrEmpty(mainModule.FileVersionInfo.FileVersion) ? 243 string.Empty : 244 string.Format(" <{0}>", 245 mainModule.FileVersionInfo.FileVersion)))); 246 } 247 catch (Win32Exception) 248 { 249 } 250 } 251 } 204 252 205 253 //Exception Information
Note: See TracChangeset
for help on using the changeset viewer.
