Contents

.net - Does a C# app track how long its been running? - Stack Overflow看到的,很方便的。
System.Diagnostics.Process 有个属性记录的应用的开始时间。

1
2
System.Diagnostics.Process current = System.Diagnostics.Process.GetCurrentProcess();
DateTime startedTime = current.StartTime;
Contents