c#获取当前进程使用内存

 

 

        public static string GetMemory()
        {
            Process proc = Process.GetCurrentProcess();
            long b = proc.PrivateMemorySize64;
            for (int i = 0; i < 2; i++)
            {
                b /= 1024;
            }
            return b + "MB";
        }

posted @ 2021-12-05 13:21  易胆大888  阅读(1429)  评论(0编辑  收藏  举报