Process.StartTime 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取关联进程启动的时间。
public:
property DateTime StartTime { DateTime get(); };
[System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public DateTime StartTime { get; }
public DateTime StartTime { get; }
[<System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
member this.StartTime : DateTime
member this.StartTime : DateTime
Public ReadOnly Property StartTime As DateTime
属性值
指示 DateTime 何时启动关联的进程。
- 属性
例外
你正在尝试访问 StartTime 远程计算机上运行的进程的属性。 此属性仅适用于在本地计算机上运行的进程。
没有与此对象关联的进程;在Windows上,没有可用的进程句柄;或者,在 Unix 上,该值未缓存,在进程退出后不可用。
调用 Windows 函数时出错。
注解
在Windows,如果进程的句柄可用,则可以在进程退出后读取此属性。 在 Unix 上,此属性在首次访问时缓存其值。 在进程退出后,可以读取缓存值,但在进程退出后访问未缓存的值在值不可用时可能会引发 InvalidOperationException 。