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

  • 相关阅读:
    FPGA quartus开发中常见的错误处理
    verilog中wire与reg类型的区别
    VC++6.0中ClassView中类消失 解决方案[转自网络]
    C++ 和 MFC的学习
    最近单片机编程中的心得
    #ifdef __cplusplus extern "C" { #endif”的定义的含义
    ES6字符串拼接新方法-模板字符串表达式
    JavaScript事件参数对象event
    JavaScript offset家族
    详解JavaScript中的replace()函数
  • 原文地址:https://www.cnblogs.com/hgfg331/p/3526623.html
Copyright © 2011-2022 走看看