Changeset 77
- Timestamp:
- Jul 14, 2006, 2:37:00 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MacFaceFloat/MacFaceApp.cs
r75 r77 49 49 } 50 50 51 /// <summary> 52 /// Windows 2000 ÍptH[}Xj^ª_Èç»ê¼êAPIŪñÎé 53 /// </summary> 54 public void SetupStatisticsForWindows2000() 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 } 77 } 78 79 public void SetupStatisticsForWindowsXP() 80 { 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 } 101 } 102 51 103 public MacFaceApp() 52 104 { … … 54 106 config.Load(); 55 107 56 cpuStats = new CPUStatistics(81);57 memStats = new MemoryStatistics(81);58 108 pageio_count = 0; 59 // XXX: Îû@ªA·¬ÈÌð½Æ©·é 60 try 61 { 62 // µÉJE^ðÀsµÄÝé 63 cpuStats.Update(); 64 } 65 catch (System.ComponentModel.Win32Exception e) 66 { 67 // _¾Á½ÌÅptH[}XJE^ðgíÈ¢û@Ö 68 cpuStats = new CPUStatisticsGetSystemTime(61); 69 memStats = new MemoryStatisticsPSAPI(61); 109 110 // OS ²ÆÉæ¾·éû@ðÏX·é 111 if (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 0) 112 { 113 SetupStatisticsForWindows2000(); 114 } 115 else 116 { 117 // XP / 2003 / Vista 118 SetupStatisticsForWindowsXP(); 70 119 } 71 120 -
trunk/MacFaceLibrary/CPUStatisticsGetSystemTime.cs
r73 r77 6 6 { 7 7 /// <summary> 8 /// CPUStatisticsGetSystemTime nngY8 /// CPUStatisticsGetSystemTime 9 9 /// </summary> 10 10 public class CPUStatisticsGetSystemTime : CPUStatistics -
trunk/MacFaceLibrary/MacFaceLibrary.csproj
r73 r77 110 110 /> 111 111 <File 112 RelPath = "CPUStatisticsNtQuerySystemInformation.cs" 113 SubType = "Code" 114 BuildAction = "Compile" 115 /> 116 <File 112 117 RelPath = "CPUUsage.cs" 113 118 SubType = "Code" … … 126 131 <File 127 132 RelPath = "MemoryStatistics.cs" 133 SubType = "Code" 134 BuildAction = "Compile" 135 /> 136 <File 137 RelPath = "MemoryStatisticsGlobalMemoryStatusEx.cs" 128 138 SubType = "Code" 129 139 BuildAction = "Compile"
Note: See TracChangeset
for help on using the changeset viewer.