欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

qc 二次开发 用 vbscript 下传附件

更新时间: 2014-01-05 01:52:18 责任编辑: Author_N1

 

qc 二次开发 用 VBScript 上传附件
Public Function AddAttachmentOnQC(TestObject, FileName)
On Error Resume Next
'通过AddItem(Null)方法取得Attachment对象
Set AttachmentFactory = TestObject.Attachments
Set Attachment = AttachmentFactory.AddItem(Null)
'上传文件并更新
Attachment.FileName = FileName
Attachment.Type = 1
Attachment.Post
Attachment.Refresh
AddAttachmentOnQC = True
'错误情况处理
If Err.Number <> 0 Then
Err.Clear
GetAttachmentOnQC = False
wscript.echo "false"
On Error GoTo 0
else
wscript.echo "true"
End If
End Function


Set tdconnction = CreateObject("TDApiOle80.TDConnection")
tdconnction.InitConnectionEx "http://lab11:8888/qcbin"
tdconnction.ConnectProjectEx "DEFAULT","QualityCenter_Demo","alex_qc",""
Set BugFact = tdconnction.BugFactory
Set TestObject = BugFact.Item(1)
AddAttachmentOnQC TestObject, "F:\a\复件 BUG_32_Transaction Response Time.xls"
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 01:52:18
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/2299/
本文WWW.DOC100.NET DOC100.NET版权所有。