是否可以在c#中获取Windows操作系统的最后备份详细信息?

时间:2016-02-26 10:40:46

标签: c# windows-10 desktop

我正在尝试创建一个显示Windows操作系统上次备份时间和日期的WPF应用程序。我尝试使用EventLogger,但我找不到详细信息。有没有办法让Windows上次备份时间和日期?

1 个答案:

答案 0 :(得分:2)

您正在寻找Environment Class

  

提供有关当前的信息和操作方法   环境和平台。这个类不能被继承。

修改

您还可以查看:Creating System Restore Points using PInvoke

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RestorePointInfo
{
    public int dwEventType;     // The type of event
    public int dwRestorePtType;     // The type of restore point
    public Int64 llSequenceNumber;  // The sequence number of the restore point
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MaxDescW + 1)] 
    public string szDescription;    // The description to be displayed so 
                //the user can easily identify a restore point
}