共用方式為


IAttachmentOwner.CreateAttachment 方法 (String, SourceFileAction)

從檔案建立附件,上載之後選擇性地刪除原始檔。

命名空間:  Microsoft.TeamFoundation.TestManagement.Client
組件:  Microsoft.TeamFoundation.TestManagement.Client (在 Microsoft.TeamFoundation.TestManagement.Client.dll 中)

語法

'宣告
Function CreateAttachment ( _
    sourceFileName As String, _
    deleteOnCompletion As SourceFileAction _
) As ITestAttachment
ITestAttachment CreateAttachment(
    string sourceFileName,
    SourceFileAction deleteOnCompletion
)
ITestAttachment^ CreateAttachment(
    String^ sourceFileName, 
    SourceFileAction deleteOnCompletion
)
abstract CreateAttachment : 
        sourceFileName:string * 
        deleteOnCompletion:SourceFileAction -> ITestAttachment
function CreateAttachment(
    sourceFileName : String, 
    deleteOnCompletion : SourceFileAction
) : ITestAttachment

參數

  • sourceFileName
    類型:String

    要附加之檔案的完整檔名。

傳回值

類型:Microsoft.TeamFoundation.TestManagement.Client.ITestAttachment
新的附件。

備註

加入並儲存物件時,指定的檔案將上傳至該伺服器,或在佇列中等待上傳。 直到上傳完成為止,它都必須是可讀取的。 附件加入到伺服器呼叫 Add 方法。

.NET Framework 安全性

請參閱

參考

IAttachmentOwner 介面

CreateAttachment 多載

Microsoft.TeamFoundation.TestManagement.Client 命名空間

ITestAttachment