Changeset 81
- Timestamp:
- Jul 16, 2006, 2:49:25 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MacFaceFloat/MacFaceApp.cs
r78 r81 54 54 public void SetupStatisticsForWindows2000() 55 55 { 56 cpuStats = new CPUStatistics(81); 57 memStats = new MemoryStatistics(81); 58 59 try 60 { 61 // µÉJE^ðÀsµÄÝé 62 cpuStats.Update(); 63 memStats.Update(); 64 } 65 catch (System.ComponentModel.Win32Exception) 66 { 67 // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 68 cpuStats = new CPUStatisticsNtQuerySystemInformation(61); 69 memStats = new MemoryStatisticsGlobalMemoryStatusEx(61); 70 } 71 catch (System.InvalidOperationException) 72 { 73 // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 74 cpuStats = new CPUStatisticsNtQuerySystemInformation(61); 75 memStats = new MemoryStatisticsGlobalMemoryStatusEx(61); 76 } 56 // cpuStats = new CPUStatistics(81); 57 // memStats = new MemoryStatistics(81); 58 // 59 // try 60 // { 61 // // µÉJE^ðÀsµÄÝé 62 // cpuStats.Update(); 63 // memStats.Update(); 64 // } 65 // catch (System.ComponentModel.Win32Exception) 66 // { 67 // // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 68 // cpuStats = new CPUStatisticsNtQuerySystemInformation(61); 69 // memStats = new MemoryStatisticsGlobalMemoryStatusEx(61); 70 // } 71 // catch (System.InvalidOperationException) 72 // { 73 // // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 74 // cpuStats = new CPUStatisticsNtQuerySystemInformation(61); 75 // memStats = new MemoryStatisticsGlobalMemoryStatusEx(61); 76 // } 77 78 cpuStats = new CPUStatisticsNtQuerySystemInformation(61); 79 memStats = new MemoryStatisticsNtQuerySystemInformation(61); 77 80 } 78 81 79 82 public void SetupStatisticsForWindowsXP() 80 83 { 81 cpuStats = new CPUStatistics(81); 82 memStats = new MemoryStatistics(81); 83 try 84 { 85 // µÉJE^ðÀsµÄÝé 86 cpuStats.Update(); 87 memStats.Update(); 88 } 89 catch (System.ComponentModel.Win32Exception) 90 { 91 // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 92 cpuStats = new CPUStatisticsGetSystemTime(61); 93 memStats = new MemoryStatisticsPSAPI(61); 94 } 95 catch (System.InvalidOperationException) 96 { 97 // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 98 cpuStats = new CPUStatisticsGetSystemTime(61); 99 memStats = new MemoryStatisticsPSAPI(61); 100 } 84 // cpuStats = new CPUStatistics(81); 85 // memStats = new MemoryStatistics(81); 86 // try 87 // { 88 // // µÉJE^ðÀsµÄÝé 89 // cpuStats.Update(); 90 // memStats.Update(); 91 // } 92 // catch (System.ComponentModel.Win32Exception) 93 // { 94 // // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 95 // cpuStats = new CPUStatisticsGetSystemTime(61); 96 // memStats = new MemoryStatisticsNtQuerySystemInformation(61); 97 // } 98 // catch (System.InvalidOperationException) 99 // { 100 // // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 101 // cpuStats = new CPUStatisticsGetSystemTime(61); 102 // memStats = new MemoryStatisticsPSAPI(61); 103 // } 104 105 cpuStats = new CPUStatisticsGetSystemTime(61); 106 memStats = new MemoryStatisticsNtQuerySystemInformation(61); 101 107 } 102 108 … … 483 489 using (StreamWriter sw = new StreamWriter(stream)) 484 490 { 491 Assembly asm = Assembly.GetExecutingAssembly(); 492 485 493 sw.WriteLine("¶: {0}", DateTime.Now); 486 494 sw.WriteLine(); 487 495 sw.WriteLine("MacFace for Windows:"); 488 496 sw.WriteLine("========================"); 489 sw.WriteLine("o[W: {0}", Application.ProductVersion);497 sw.WriteLine("o[W: {0}", ((ApplicationVersionStringAttribute)(asm.GetCustomAttributes(typeof(ApplicationVersionStringAttribute), true))[0]).Version); 490 498 sw.WriteLine("AZu: {0}", Assembly.GetExecutingAssembly().FullName); 491 499 sw.WriteLine(); -
trunk/MacFaceLibrary/MacFaceLibrary.csproj
r77 r81 140 140 /> 141 141 <File 142 RelPath = "MemoryStatisticsNtQuerySystemInformation.cs" 143 SubType = "Code" 144 BuildAction = "Compile" 145 /> 146 <File 142 147 RelPath = "MemoryStatisticsPSAPI.cs" 143 148 SubType = "Code"
Note: See TracChangeset
for help on using the changeset viewer.