TeamFoundationFileService.UploadFile 方法 (TeamFoundationRequestContext, Int32%, Stream, array<Byte[], Int64, Int64, Int64, CompressionType, OwnerId, String, Int32, Boolean)
上载到 blob 应用仓库的特定文件
命名空间: Microsoft.TeamFoundation.Framework.Server
程序集: Microsoft.TeamFoundation.Framework.Server(在 Microsoft.TeamFoundation.Framework.Server.dll 中)
语法
声明
Public Function UploadFile ( _
requestContext As TeamFoundationRequestContext, _
ByRef fileId As Integer, _
content As Stream, _
hashValue As Byte(), _
compressedLength As Long, _
uncompressedLength As Long, _
offsetFrom As Long, _
compressionType As CompressionType, _
ownerId As OwnerId, _
fileName As String, _
relatedFileId As Integer, _
compressContent As Boolean _
) As Boolean
public bool UploadFile(
TeamFoundationRequestContext requestContext,
ref int fileId,
Stream content,
byte[] hashValue,
long compressedLength,
long uncompressedLength,
long offsetFrom,
CompressionType compressionType,
OwnerId ownerId,
string fileName,
int relatedFileId,
bool compressContent
)
参数
- requestContext
类型:Microsoft.TeamFoundation.Framework.Server.TeamFoundationRequestContext
设置为 true compressContent 导致 UploadFile 在上载之前压缩内容流。如果压缩比原始的、未生成更大的文件,该文件将存储为未压缩。注意:如果 compressContent 设置为 true,则应设置其他参数,如同流用于存储为未压缩 (IE、compressedLength 和 uncompressedLength 两个设置内容。长度)。
- fileId
类型:System.Int32%
- content
类型:System.IO.Stream
- hashValue
类型:array<System.Byte[]
- compressedLength
类型:System.Int64
- uncompressedLength
类型:System.Int64
- offsetFrom
类型:System.Int64
- compressionType
类型:Microsoft.TeamFoundation.Framework.Server.CompressionType
- fileName
类型:System.String
- relatedFileId
类型:System.Int32
- compressContent
类型:System.Boolean
返回值
类型:System.Boolean
则为 true,则上载完成 (即这是最后区块)
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。