MqttSyncClientUploadFileAsync 方法 (Bitmap, String, String, String, ActionInt64, Int64, HslCancelToken) |
[文件引擎] 上传一个Bitmap图片对象到服务器指定的分类下面,需要指定分类信息,服务器保存的文件名,描述信息,支持进度报告
[File Engine] Upload a Bitmap image object to the category specified by the server, you need to specify the category information,
the file name saved by the server, description information, and support for progress reports
命名空间:
HslCommunication.MQTT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public Task<OperateResult> UploadFileAsync(
Bitmap bitmap,
string groups,
string serverName,
string fileTag,
Action<long, long> processReport,
HslCancelToken cancelToken = null
)
Public Function UploadFileAsync (
bitmap As Bitmap,
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(
Bitmap^ bitmap,
String^ groups,
String^ serverName,
String^ fileTag,
Action<long long, long long>^ processReport,
HslCancelToken^ cancelToken = nullptr
)
member UploadFileAsync :
bitmap : Bitmap *
groups : string *
serverName : string *
fileTag : string *
processReport : Action<int64, int64> *
?cancelToken : HslCancelToken
(* Defaults:
let _cancelToken = defaultArg cancelToken null
*)
-> Task<OperateResult>
参数
- bitmap
- 类型:System.DrawingBitmap
图片对象 - groups
- 类型:SystemString
文件的类别,例如 Files/Personal/Admin 按照斜杠来区分 - serverName
- 类型:SystemString
在服务器保存的文件名称 - fileTag
- 类型:SystemString
文件的额外的描述信息 - processReport
- 类型:SystemActionInt64, Int64
进度报告,第一个参数是已完成字节数,第二个参数是总字节数 - cancelToken (Optional)
- 类型:HslCommunication.CoreHslCancelToken
取消上传操作的令牌
返回值
类型:
TaskOperateResult是否上传成功
参见