<del id="d4fwx"><form id="d4fwx"></form></del>
      <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

            <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
          • C#實(shí)現(xiàn)進(jìn)程內(nèi)存信息獲取-創(chuàng)新互聯(lián)

            usingSystem.Collections.Generic;
            usingSystem.Runtime.InteropServices;
            usingSystem;
            usingSystem.Diagnostics;
            staticclassNat
            {
               [StructLayout(LayoutKind.Sequential]
               struct IO_COUNTERS
               {
                   publiculongReadOperationCount;
                   publiculongWriteOperationCount;
                   publiculongOtherOperationCount;
                   publiculongReadTransferCount;
                   publiculongWriteTransferCount;
                   publiculongOtherTransferCount;
               }
               [DllImport("kernel32.dll")]
               unsafestaticextern boolGetProcessIoCounters(IntPtrProcessHandle,out IO_COUNTERSIoCounters);

               [StructLayout(LayoutKind.Sequential,Size=40)]
               privatestruct PROCESS_MEMORY_COUNTERS
               {
                   publicuint cb;
                   publicuintPageFaultCount;
                   publicuintPeakWorkingSetSize;
                   publicuintWorkingSetSize;
                   publicuintQuotaPeakPagedPoolUsage;
                   publicuintQuotaPagedPoolUsage;
                   publicuintQuotaPeakNonPagedPoolUsage;
                   publicuintQuotaNonPagedPoolUsage;
                   publicuintPagefileUsage;
                   publicuintPeakPagefileUsage;
               }

               [DllImport("psapi.dll",SetLastError=true)]
               unsafestaticextern boolGetProcessMemoryInfo(IntPtr* hProcess,out PROCESS_MEMORY_COUNTERS*Memcounters,int size);

               publicstaticclass IO
               {
                   unsafepublicstaticDictionary<string,ulong>GetALLIO(Process procToRtrivIO)
                   {
                       IO_COUNTERS counters;
                       Dictionary<string,ulong> retCountIoDict=newDictionary<string,ulong>();
                       IntPtr ptr=System.Diagnostics.Process.GetCurrentProcess().Handle;

                       GetProcessIoCounters(ptr,out counters);
                       retCountIoDict.Add("ReadOperationCount", counters.ReadOperationCount);
                       retCountIoDict.Add("WriteOperationCount", counters.WriteOperationCount);
                       retCountIoDict.Add("OtherOperationCount", counters.OtherOperationCount);
                       retCountIoDict.Add("ReadTransferCount", counters.ReadTransferCount);
                       retCountIoDict.Add("WriteTransferCount", counters.WriteTransferCount);
                       retCountIoDict.Add("OtherTransferCount", counters.OtherTransferCount);
                       return retCountIoDict;
                       //return "This process has read " + ((counters.ReadTransferCount/1024)/1024).ToString("N0") +
                       //   " Mb of data.";

                   }
               }
               publicstaticclassMem
               {
                   unsafepublicstaticDictionary<string,uint>GetAllMem(Process procToRtrivMem)
                   {

                       PROCESS_MEMORY_COUNTERS*MemCounters;
                       Dictionary<string,uint> retCountMemDict=newDictionary<string,uint>();
                       IntPtr ptr=System.Diagnostics.Process.GetCurrentProcess().Handle;

                       GetProcessMemoryInfo(&ptr,outMemCounters,Marshal.SizeOf(typeof(PROCESS_MEMORY_COUNTERS)));//MemCounters.cb);
                       retCountMemDict.Add("cb",MemCounters->cb);
                       retCountMemDict.Add("PageFaultCount",MemCounters->PageFaultCount);
                       retCountMemDict.Add("PeakWorkingSetSize",MemCounters->PeakWorkingSetSize);
                       retCountMemDict.Add("WorkingSetSize",MemCounters->WorkingSetSize);
                       retCountMemDict.Add("QuotaPeakPagedPoolUsage",MemCounters->QuotaPeakPagedPoolUsage);
                       retCountMemDict.Add("QuotaPagedPoolUsage",MemCounters->QuotaPagedPoolUsage);

                       retCountMemDict.Add("QuotaPeakNonPagedPoolUsage",MemCounters->QuotaPeakNonPagedPoolUsage);
                       retCountMemDict.Add("QuotaNonPagedPoolUsage",MemCounters->QuotaNonPagedPoolUsage);
                       retCountMemDict.Add("PagefileUsage",MemCounters->PagefileUsage);
                       retCountMemDict.Add("PeakPagefileUsage",MemCounters->PeakPagefileUsage);

                       return retCountMemDict;
                       //return "This process has read " + ((counters.ReadTransferCount/1024)/1024).ToString("N0") +
                       //   " Mb of data.";

                   }
               }
            }
            C#實(shí)現(xiàn)進(jìn)程內(nèi)存信息獲取

             參考:using unsafe code in C# asp.net  http://stackoverflow.com/questions/17207310/using-unsafe-code-in-c-sharp-asp-net

            創(chuàng)新互聯(lián)公司從2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元塔什庫爾干塔吉克做網(wǎng)站,已為上家服務(wù),為塔什庫爾干塔吉克各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18980820575

            collectiong memory usage information for a processhttp://msdn.microsoft.com/en-us/library/windows/desktop/ms682050(v=vs.85).aspx

            在C#中調(diào)用psapi.dll內(nèi)置的GetProcessMemoryInfo函數(shù)http://social.microsoft.com/Forums/it-IT/650197e0-a21a-4f5e-a974-23f074f52a55/cpsapidllgetprocessmemoryinfo?forum=visualcshartzhchs

            ASP.NET(C#)獲取當(dāng)前計(jì)算機(jī)CPU內(nèi)存使用率等相關(guān)信息http://luzinwbing.blog.163.com/blog/static/113805840201031093415658/

             不安全代碼只會(huì)在使用/unsafe編譯情況下使用 http://lixiaorong223.blog.163.com/blog/static/44011629200993181241924/

            wmi獲得進(jìn)程的虛擬內(nèi)存與任務(wù)管理器中顯示的不一致 http://bbs.csdn.net/topics/260033107

            文章標(biāo)題:C#實(shí)現(xiàn)進(jìn)程內(nèi)存信息獲取-創(chuàng)新互聯(lián)
            文章鏈接:http://www.jbt999.com/article18/cddpdp.html

            成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營(yíng)銷推廣手機(jī)網(wǎng)站建設(shè)面包屑導(dǎo)航App設(shè)計(jì)網(wǎng)站排名關(guān)鍵詞優(yōu)化

            廣告

            聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

            成都app開發(fā)公司

              <del id="d4fwx"><form id="d4fwx"></form></del>
              <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

                    <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
                  • 青青青青青青操 | 九一成人电影 | 国产v在线 | 天天肏屄视频 | 国产极品se婷婷 |