描述
IWbemBackupRestore.Backup方法将静态存储库的内容备份到单独的文件中。
C++ 语法
| HRESULT Backup( [in] LPCWSTR strBackupToFile, [in] long lFlags ); | 
PowerBASIC 语法
| METHOD Backup ( _ BYREF strBackupToFile AS WSTRINGZ, _ BYVAL lFlags AS LONG _ ) AS LONG | 
参数
strBackupToFile
包含要备份存储库内容的文件名的16位Unicode字符的常量,以null结尾的字符串。
lFlags
保留。该参数必须为0(零)。
返回值
此方法返回一个HRESULT,指示方法调用的状态。下表列出了HRESULT中包含的值。
| 退货代码 | 描述 | 
| WBEM_E_INVALID_PARAMETER | 其中一个论点是无效的。 | 
| WBEM_E_ACCESS_DENIED | 用户没有权利执行此操作。有关详细信息,请参阅维护WMI安全. | 
| S_OK | 方法成功。 | 
示例代码
以下C ++示例显示如何调用IWbemBackupRestore.Backup方法。
// The pInt variable is of type IWbemBackupRestore*
pInt->Backup(L"c:\\\\winnt\\system32\\wbem\\repository\\back.x", 0);
备注
注意由于可能不会在与客户端需求相同的身份验证级别返回到宿的回调,建议您使用半异步而不是异步通信。
要求
| 客户 | 需要Windows Vista,Windows XP,Windows 2000 Professional,Windows NT Workstation 4.0 SP4及更高版本,Windows Me,Windows 98或Windows 95。 | 
| 服务器 | 需要Windows Server 2008,Windows Server 2003,Windows 2000 Server或Windows NT Server 4.0 SP4及更高版本。 | 
| 头 | 在Wbemcli.inc中声明。 | 
| DLL | 需要Wbemsvc.dll。 | 


