Changeset 81


Ignore:
Timestamp:
Jul 16, 2006, 2:49:25 PM (18 years ago)
Author:
mayuki
Message:

パフォーマンスカウンタを利用しないようにした

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MacFaceFloat/MacFaceApp.cs

    r78 r81  
    5454                public void SetupStatisticsForWindows2000()
    5555                {
    56                         cpuStats = new CPUStatistics(81);
    57                         memStats = new MemoryStatistics(81);
    58 
    59                         try
    60                         {
    61                                 // ŽŽ‚µ‚ɃJƒEƒ“ƒ^‚ðŽÀs‚µ‚Ä‚Ý‚é
    62                                 cpuStats.Update();
    63                                 memStats.Update();
    64                         }
    65                         catch (System.ComponentModel.Win32Exception)
    66                         {
    67                                 // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽg‚í‚È‚¢•û–@‚Ö
    68                                 cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
    69                                 memStats = new MemoryStatisticsGlobalMemoryStatusEx(61);
    70                         }
    71                         catch (System.InvalidOperationException)
    72                         {
    73                                 // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽ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//                              // ŽŽ‚µ‚ɃJƒEƒ“ƒ^‚ðŽÀs‚µ‚Ä‚Ý‚é
     62//                              cpuStats.Update();
     63//                              memStats.Update();
     64//                      }
     65//                      catch (System.ComponentModel.Win32Exception)
     66//                      {
     67//                              // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽg‚í‚È‚¢•û–@‚Ö
     68//                              cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
     69//                              memStats = new MemoryStatisticsGlobalMemoryStatusEx(61);
     70//                      }
     71//                      catch (System.InvalidOperationException)
     72//                      {
     73//                              // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽg‚í‚È‚¢•û–@‚Ö
     74//                              cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
     75//                              memStats = new MemoryStatisticsGlobalMemoryStatusEx(61);
     76//                      }
     77
     78                        cpuStats = new CPUStatisticsNtQuerySystemInformation(61);
     79                        memStats = new MemoryStatisticsNtQuerySystemInformation(61);
    7780                }
    7881
    7982                public void SetupStatisticsForWindowsXP()
    8083                {
    81                         cpuStats = new CPUStatistics(81);
    82                         memStats = new MemoryStatistics(81);
    83                         try
    84                         {
    85                                 // ŽŽ‚µ‚ɃJƒEƒ“ƒ^‚ðŽÀs‚µ‚Ä‚Ý‚é
    86                                 cpuStats.Update();
    87                                 memStats.Update();
    88                         }
    89                         catch (System.ComponentModel.Win32Exception)
    90                         {
    91                                 // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽg‚í‚È‚¢•û–@‚Ö
    92                                 cpuStats = new CPUStatisticsGetSystemTime(61);
    93                                 memStats = new MemoryStatisticsPSAPI(61);
    94                         }
    95                         catch (System.InvalidOperationException)
    96                         {
    97                                 // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽ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//                              // ŽŽ‚µ‚ɃJƒEƒ“ƒ^‚ðŽÀs‚µ‚Ä‚Ý‚é
     89//                              cpuStats.Update();
     90//                              memStats.Update();
     91//                      }
     92//                      catch (System.ComponentModel.Win32Exception)
     93//                      {
     94//                              // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽg‚í‚È‚¢•û–@‚Ö
     95//                              cpuStats = new CPUStatisticsGetSystemTime(61);
     96//                              memStats = new MemoryStatisticsNtQuerySystemInformation(61);
     97//                      }
     98//                      catch (System.InvalidOperationException)
     99//                      {
     100//                              // ƒ_ƒ‚¾‚Á‚½‚̂ŃpƒtƒH[ƒ}ƒ“ƒXƒJƒEƒ“ƒ^‚ðŽg‚í‚È‚¢•û–@‚Ö
     101//                              cpuStats = new CPUStatisticsGetSystemTime(61);
     102//                              memStats = new MemoryStatisticsPSAPI(61);
     103//                      }
     104
     105                        cpuStats = new CPUStatisticsGetSystemTime(61);
     106                        memStats = new MemoryStatisticsNtQuerySystemInformation(61);
    101107                }
    102108
     
    483489                                                using (StreamWriter sw = new StreamWriter(stream))
    484490                                                {
     491                                                        Assembly asm = Assembly.GetExecutingAssembly();
     492
    485493                                                        sw.WriteLine("”­¶Žž: {0}", DateTime.Now);
    486494                                                        sw.WriteLine();
    487495                                                        sw.WriteLine("MacFace for Windows:");
    488496                                                        sw.WriteLine("========================");
    489                                                         sw.WriteLine("ƒo[ƒWƒ‡ƒ“: {0}", Application.ProductVersion);
     497                                                        sw.WriteLine("ƒo[ƒWƒ‡ƒ“: {0}", ((ApplicationVersionStringAttribute)(asm.GetCustomAttributes(typeof(ApplicationVersionStringAttribute), true))[0]).Version);
    490498                                                        sw.WriteLine("ƒAƒZƒ“ƒuƒŠ: {0}", Assembly.GetExecutingAssembly().FullName);
    491499                                                        sw.WriteLine();
  • trunk/MacFaceLibrary/MacFaceLibrary.csproj

    r77 r81  
    140140                />
    141141                <File
     142                    RelPath = "MemoryStatisticsNtQuerySystemInformation.cs"
     143                    SubType = "Code"
     144                    BuildAction = "Compile"
     145                />
     146                <File
    142147                    RelPath = "MemoryStatisticsPSAPI.cs"
    143148                    SubType = "Code"
Note: See TracChangeset for help on using the changeset viewer.