MqttSyncClientUploadFileAsync 方法 (Stream, String, String, String, ActionInt64, Int64, HslCancelToken) |
[文件引擎] 上传流给服务器,需要指定流,服务器保存的名字,以及上传到服务器的分类信息,支持进度汇报功能。
[File Engine] To upload a stream to the server, you need to specify the stream, the name saved by the server, and the classification information uploaded to the server to support the progress reporting function.
命名空间:
HslCommunication.MQTT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public Task<OperateResult> UploadFileAsync(
Stream stream,
string groups,
string serverName,
string fileTag,
Action<long, long> processReport,
HslCancelToken cancelToken = null
)
Public Function UploadFileAsync (
stream As Stream,
groups As String,
serverName As String,
fileTag As String,
processReport As Action(Of Long, Long),
Optional cancelToken As HslCancelToken = Nothing
) As Task(Of OperateResult)
public:
Task<OperateResult^>^ UploadFileAsync(
Stream^ stream,
String^ groups,
String^ serverName,
String^ fileTag,
Action<long long, long long>^ processReport,
HslCancelToken^ cancelToken = nullptr
)
member UploadFileAsync :
stream : Stream *
groups : string *
serverName : string *
fileTag : string *
processReport : Action<int64, int64> *
?cancelToken : HslCancelToken
(* Defaults:
let _cancelToken = defaultArg cancelToken null
*)
-> Task<OperateResult>
参数
- stream
- 类型:System.IOStream
流 - groups
- 类型:SystemString
文件的类别,例如 Files/Personal/Admin 按照斜杠来区分 - serverName
- 类型:SystemString
文件的额外的描述信息 - fileTag
- 类型:SystemString
[缺少 "M:HslCommunication.MQTT.MqttSyncClient.UploadFileAsync(System.IO.Stream,System.String,System.String,System.String,System.Action{System.Int64,System.Int64},HslCommunication.Core.HslCancelToken)" 的 <param name="fileTag"/> 文档]
- processReport
- 类型:SystemActionInt64, Int64
进度报告,第一个参数是已完成字节数,第二个参数是总字节数 - cancelToken (Optional)
- 类型:HslCommunication.CoreHslCancelToken
取消上传操作的令牌
返回值
类型:
TaskOperateResult是否上传成功的结果对象
参见