zoukankan      html  css  js  c++  java
  • QTP 新建日志

    '    Const Reading=1,Writing=2,Appending=8
    '    Set Fso=CreateObject("Scripting.FileSystemObject")
    '    Dim txtPath
    '    a=DATE()
    '    Datetime = date
    '    Parameter = Array("yyyy","m","d")
    '    For Each P In Parameter
    '        Temp = DatePart(P,Datetime)
    '        If Len(Temp) = 1 Then
    '            Temp = "0"&Temp
    '        End If
    '        strTime = strTime & Temp
    '    Next
    '    c = strTime
    '    MsgBox c
    '    txtPath="E:Log"+c+".txt"
    '    msgbox txtPath
    '    If Fso.FileExists(txtPath) then
    '        Set logFile=Fso.OpenTextFile(txtPath,8,true)
    '        logFile.WriteLine(words)
                            
    '    else
    '        Set logFile=Fso.CreateTextFile(txtPath,2,true)
    '        logFile.WriteLine(words)
    '    End if
            
    '    logFile.close
    '    Set logFile=Nothing
    '    Set Fso=Nothing    
    'End Function

    Public Function WritLog(words)
        Dim Fso
        Const Reading=1,Writing=2,Appending=8
        Set Fso=CreateObject("Scripting.FileSystemObject")
        Dim txtPath
    '    msgbox a    
        c=FormatDateTime(date,1)
    '    msgbox c
        txtPath="E:Log"+c+".txt"
    '    msgbox txtPath
        If Fso.FileExists(txtPath) then
            Set logFile=Fso.OpenTextFile (txtPath,8,false)
            logFile.WriteLine(words)                        
        else
            Set logFile=Fso.CreateTextFile(txtPath,2,false)
            logFile.WriteLine(words)
        End if        
        logFile.close
        Set logFile=Nothing
        Set Fso=Nothing    
    End Function

  • 相关阅读:
    jQuery 设置checkbox全选
    jQuery 判断checkbox是否选中的方法
    jQuery 设置控件的显示与隐藏
    play freamwork 页面的Html+Groovy模板中添加Java代码
    play freamwork 页面的Html+Groovy模板中的if判断
    play freamwork 页面的form表单样式
    获取微信用户列表Openid
    play freamwork 定时任务
    Xitrum学习笔记20
    Xitrum学习笔记19
  • 原文地址:https://www.cnblogs.com/hgfg331/p/3526623.html
Copyright © 2011-2022 走看看