首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > vbScript >

qc 二次开发 用 VBScript 下传附件

2012-11-15 
qc 二次开发 用 VBScript 上传附件Public Function AddAttachmentOnQC(TestObject, FileName)On Error Res

qc 二次开发 用 VBScript 上传附件

Public Function AddAttachmentOnQC(TestObject, FileName)On Error Resume Next'通过AddItem(Null)方法取得Attachment对象Set AttachmentFactory = TestObject.AttachmentsSet Attachment = AttachmentFactory.AddItem(Null)'上传文件并更新Attachment.FileName = FileNameAttachment.Type = 1Attachment.PostAttachment.RefreshAddAttachmentOnQC = True'错误情况处理If Err.Number <> 0 ThenErr.ClearGetAttachmentOnQC = Falsewscript.echo "false"On Error GoTo 0elsewscript.echo "true"End IfEnd FunctionSet tdconnction = CreateObject("TDApiOle80.TDConnection")tdconnction.InitConnectionEx "http://lab11:8888/qcbin"tdconnction.ConnectProjectEx "DEFAULT","QualityCenter_Demo","alex_qc",""Set BugFact = tdconnction.BugFactorySet TestObject = BugFact.Item(1)AddAttachmentOnQC TestObject, "F:\a\复件 BUG_32_Transaction Response Time.xls"

热点排行