读取xp中自己创建的用于系统还原的系统检查点 ( 积分: 100 )

  • 主题发起人 主题发起人 下雨了
  • 开始时间 开始时间

下雨了

Unregistered / Unconfirmed
GUEST, unregistred user!
小弟,想读取xp中自己创建的用于系统还原的系统检查点,读出后显示在listview中,请大虾们赐教,谢谢
 
高手赶紧露头吧
 
参考&nbsp;<br>http://msdn2.microsoft.com/en-us/library/aa378986.aspx<br>http://msdn2.microsoft.com/en-us/library/aa378951.aspx&nbsp;这儿有vbscript的例子<br>如果要在delphi用那个vbscript就看下面这些步骤:<br>1)安装Windows&nbsp;Script&nbsp;Control:<br>下载Windows&nbsp;Script&nbsp;Control之后要安装,然后按activex&nbsp;control的安装方法在delphi安装。<br>可以看这个网址:<br>http://www.malcolmgroves.com/stories/2004/09/23/scriptingYourDelphiApplications.html<br>Windows&nbsp;Script&nbsp;Control下载地址<br>http://download.microsoft.com/download/winscript56/Install/1.0/W982KMeXP/EN-US/sct10en.exe&nbsp;<br>2)新建一个工程,加ScriptControl1,Memo1,Button1.<br>设置ScriptControl1的Language属性为'vbscript'<br>然后加这个代码<br>---<br>const<br>&nbsp;restorepointsscript:string=<br>'function&nbsp;SysRestorePoint(i)'+#13#10+<br>'Set&nbsp;RPSet&nbsp;=&nbsp;GetObject(&quot;winmgmts:root/default&quot;).InstancesOf&nbsp;(&quot;SystemRestore&quot;)'+#13#10+<br>'for&nbsp;each&nbsp;RP&nbsp;in&nbsp;RPSet'&nbsp;+#13#10+<br>&nbsp;&nbsp;&nbsp;'s=s&amp;&nbsp;&quot;Dir:&nbsp;RP&quot;&nbsp;&amp;&nbsp;RP.SequenceNumber&nbsp;&amp;&nbsp;&quot;,&nbsp;Name:&nbsp;&quot;&nbsp;&amp;&nbsp;RP.Description&nbsp;&amp;&nbsp;&quot;,&nbsp;Type:&nbsp;&quot;&amp;RP.RestorePointType&nbsp;&amp;&nbsp;&quot;,Time:&nbsp;&quot;&nbsp;&amp;&nbsp;RP.CreationTime&amp;vbnewline'+#13#10+<br>'next'+#13#10+<br>'SysRestorePoint=s'+#13#10+<br>'end&nbsp;function';<br>---<br>uses<br>&nbsp;&nbsp;ActiveX;<br>---<br>procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<br>var<br>&nbsp;&nbsp;Params&nbsp;:&nbsp;PSafeArray;<br>&nbsp;&nbsp;v&nbsp;:&nbsp;Variant;<br>begin<br>&nbsp;&nbsp;v&nbsp;:=&nbsp;VarArrayCreate([0,&nbsp;0],&nbsp;varVariant);<br>&nbsp;&nbsp;v[0]&nbsp;:=&nbsp;0;&nbsp;//&nbsp;parameter&nbsp;passed&nbsp;to&nbsp;function<br><br>&nbsp;&nbsp;Params&nbsp;:=&nbsp;PSafeArray(TVarData(v).VArray);<br>&nbsp;&nbsp;ScriptControl1.AddCode(restorepointsscript);<br>&nbsp;&nbsp;Memo1.lines.add(&nbsp;ScriptControl1.Run('SysRestorePoint',&nbsp;Params));<br><br>end;<br>---<br>procedure&nbsp;TForm1.FormShow(Sender:&nbsp;TObject);<br>begin<br>&nbsp;&nbsp;ScriptControl1.SitehWnd&nbsp;:=&nbsp;Self.Handle;<br>end;<br>---<br><br>结果会在Memo1显示。至于怎么显示,在哪儿显示你自己改<br>--------<br>Scripting&nbsp;Your&nbsp;Delphi&nbsp;Applications&nbsp;附加几个例子可以参考一下<br><br>Kind&nbsp;regards,<br>cipher
 
后退
顶部