TA的每日心情 | 奋斗 2018-8-27 15:56 |
---|
签到天数: 322 天 连续签到: 1 天 [LV.8]测试军长
|
- '==========================================================================
- ' NAME: User Login
- ' AUTHOR: heyl
- ' DATE : 2012-12-21
- ' COMMENT:
- '==========================================================================
- Class ScreenCaptureEngine
- Public str_ScriptPath
- Public oFSO
-
- Private Sub Class_Initialize
- str_ScriptPath = str_Test_Path&"Report\"
- str_ScriptPath = str_ScriptPath&GetTestName
- me.Createreporterfolder(str_ScriptPath)
- End Sub
-
- Private Sub Class_Terminate
- Set oFSO = nothing
- End Sub
-
- 'create a folder
- Function Createreporterfolder(str_folderpath)
- Dim fso, f
- Set fso = CreateObject("Scripting.FileSystemObject")
- If Not fso.FolderExists(str_folderpath) Then
- Set f = fso.CreateFolder(str_folderpath)
- Set f = Nothing
- Set fso = Nothing
- Else
- Set fso = Nothing
- End If
- End Function
- Public Sub Report()
-
- Dim sFile
- Dim sTimeStamp
-
-
-
- Set oFSO = createobject("Scripting.FileSystemObject")
- sTimeStamp = CStr(Now)
- sTimeStamp = Replace(sTimeStamp , "\", "")
- sTimeStamp = Replace(sTimeStamp , "/", "")
- sTimeStamp = Replace(sTimeStamp , ":", "")
-
- sFile = str_ScriptPath
- If Mid(sFile, Len(sFile),1) <> "\" Then sFile = sFile & "\"
-
- sFile = sFile & " " & sTimeStamp & ".png"
-
- While oFSO.FileExists(sFile)
- sFile = Mid(sFile ,1,Len(sFile)-4) & "_1" & ".png"
- Wend
-
- Desktop.CaptureBitmap(sFile)
-
- End Sub
- End Class
- Set oScreenCapture = new ScreenCaptureEngine
复制代码
|
评分
-
查看全部评分
|