获取程序所占内存

PerformanceCounter performanceCounter = new PerformanceCounter("Process", "Working Set - Private", Process.GetCurrentProcess().ProcessName);
var result = (int)(Convert.ToInt64(performanceCounter.NextValue()) / 1024.0 / 1024.0);
posted @ 2023-06-13 16:05  follow_discoverer  阅读(12)  评论(0编辑  收藏  举报