UserProperties 属性

获取或设置应用程序消息的用户属性。读/写。变量。
语法
msg
.
UserProperties
其中
msg
- 是由 MQTTFactory 对象的方法
CreateApplicationMessage
创建的 MQTTMessage 对象。
小贴士:
此属性的数据类型为 Variant,但是,只能为其分配 MQTTUserProperty 对象的数组。
示例
Dim userProp(2) As MQTTUserProperty Dim up1 As MQTTUserProperty Dim up2 As MQTTUserProperty Set up1 = mqtt.CreateUserProperty() up1.Name = "Key 1" up1.Value = "Value 1" Set userProp(1) = up1 Set up2 = mqtt.CreateUserProperty() up2.Name = "Key 2" up2.Value = "Value 2" Set userProp(2) = up2 msg.UserProperties = userProp
提供反馈
对本文档有问题或反馈吗? 请在这里提交您的反馈
Normal