相关疑难解决方法(0)

创建系统还原点 - 有什么想法吗?

以编程方式创建系统还原点是“禁忌”吗?我会在执行软件更新之前执行此操作。如果有更好的方法仅使用我的软件的文件和数据创建还原点,请告诉我。

我想要一种方法,如果更新过程中一切都崩溃了(关闭/终止更新应用程序、断电、用户拔掉插头等),我可以让用户回到已知的工作状态

    private void CreateRestorePoint(string description)
    {
        ManagementScope oScope = new ManagementScope("\\\\localhost\\root\\default");
        ManagementPath oPath = new ManagementPath("SystemRestore");
        ObjectGetOptions oGetOp = new ObjectGetOptions();
        ManagementClass oProcess = new ManagementClass(oScope, oPath, oGetOp);

        ManagementBaseObject oInParams = oProcess.GetMethodParameters("CreateRestorePoint");
        oInParams["Description"] = description;
        oInParams["RestorePointType"] = 12; // MODIFY_SETTINGS
        oInParams["EventType"] = 100;

        ManagementBaseObject oOutParams = oProcess.InvokeMethod("CreateRestorePoint", oInParams, null); 
    }
Run Code Online (Sandbox Code Playgroud)

system-restore

5
推荐指数
1
解决办法
1620
查看次数

如何创建系统还原点?

替代文字

安装paint.net,我找到一个字符串创建系统还原点...
我想它正在为卷影服务创建一个还原点. - 不是吗?我不确定.

如果我是对的,我该如何在我的应用程序中执行此操作?
如果有合适的Apis,请告诉我.

windows winapi snapshot volume-shadow-service

3
推荐指数
1
解决办法
1305
查看次数