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

  • 相关阅读:
    Autofac(01)
    深入理解ADO.NET Entity Framework(02)
    使用excel 数据透视表画图
    C# 控制CH341进行SPI,I2C读写
    C# winform使用combobox遍历文件夹内所有文件
    通用分页存储过程
    如何让你的SQL运行得更快
    sql优化之使用索引
    SQL优化
    SQL 循环语句几种写法
  • 原文地址:https://www.cnblogs.com/zhangfei/p/2135391.html
Copyright © 2011-2022 走看看