zoukankan      html  css  js  c++  java
  • QC中UploadResource的用法

    API文档不详细,摸索半天,终于找到解决办法:

    Function uploadTestResultToQC
     Set objPath  = CreateObject("Scripting.FileSystemObject")
     If Not objPath.FileExists("C:\test\test.xls") Then
        msgbox "not exist  file"
        ExitTest
     End If
     Set objPath = nothing
        Set ResourceFactory = QCConnection.QCResourceFactory      '事先得连接上QC          
     Set ResourceFilter =  ResourceFactory.Filter
        ResourceFilter.Filter("RSC_NAME")="test.xls"
        Set ResourceList =  ResourceFilter.NewList
        If   ResourceList.Count >0 Then
     For j=1 To ResourceList.Count                   
       Set ResourceFile = ResourceList.Item(j)    
       If  ResourceFile.name = "test.xls"Then
       ResourceFile.FileName = "test.xls"  'API文档上有说明,事先得给一个filename
       ResourceFile.post   '必须先post一下,要不然上传不了

       ResourceFile.UploadResource "C:\test\"&"",true  '路径后面一定要加上"",要不然也上传不成功,这是最关键的两点
       End If
     next 
     End If 
     Set ResourceFile = nothing
     Set ResourceFilter = nothing
     Set ResourceFactory = nothing
    end function

  • 相关阅读:
    oracle 数据库关闭的的几种方式总结
    oracle热备份
    oracle 的 startup,startup mount,startup nomount之间的区别
    Oracle数据导入导出imp/exp命令总结
    oracle模糊查询效率可这样提高
    流程控制
    常量
    java序列化
    JVM锁说明
    go变量和数据类型
  • 原文地址:https://www.cnblogs.com/zhangfei/p/2135391.html
Copyright © 2011-2022 走看看