|
3#
楼主 |
发表于 2006-2-16 14:46:14
|
只看该作者
南泥湾精神...自己的问题自己解决...
代码如下:
'========================================================'
'Closes a process according to its name.
'If multiple processes exist with the same name, they are all closed.
Dim i
Dim j
For i = 0 To 4
SystemUtil.Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
Next
Wait(3)
j = SystemUtil.CloseProcessByName("IEXPLORE.EXE")
'The Return Value is tell us that how many processes of the same name have been closed at same time.
'The number of instances of the application that are closed when the statement runs.
If j = i Then
Reporter.ReportEvent micPass, "SystemUtil.CloseProcessByName passed", "j = " & j & ", i = " & i
Else
Reporter.ReportEvent micFail, "SystemUtil.CloseProcessByName Fail", "j = " & j & ", i = " & i
End If
'========================================================='
红色部分是关键,功能请仔细看注释。 |
|