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

  • 相关阅读:
    clearstatcache清除文件状态缓存
    使用mysql创建自己的物化视图
    python——复制目录结构小脚本
    开发一个jQuery插件——多级联动菜单
    pack、unpack自制二进制“数据库”
    博客爬取系统
    session放入缓存(redis)、DB
    centos+nginx从零开始配置负载均衡
    几个容易被忽略的mysql知识
    数组方式进行表单提交
  • 原文地址:https://www.cnblogs.com/hgfg331/p/3526623.html
Copyright © 2011-2022 走看看