本文整理汇总了C#中Command.AddContent方法的典型用法代码示例。如果您正苦于以下问题:C# Command.AddContent方法的具体用法?C# Command.AddContent怎么用?C# Command.AddContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command.AddContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendAuthentication
private bool SendAuthentication(string username, string password)
{
this.SendUINotice("Sending authentication information.");
Message message = new Message();
message.type = Message.Type.UserToServer;
message.creator_plugin_hash = this._hash_code;
message.destination_plugin_hash = this._user_manager_hash;
Command contents = new Command();
contents.ctype = "login";
contents.type = MessageContent.Type.Command;
contents.AddContent("username", username);
contents.AddContent("password", password);
message.content = contents;
this._controller.connection.Write(message.DumpMessage());
return true;
}
示例2: SendRequest
private void SendRequest(string username, Transceiver connection)
{
Message message = new Message();
message.type = Message.Type.ServerToUserPlugin;
message.creator_plugin_hash = this._hash_code;
message.destination_plugin_hash = this._user_manager_hash;
Command content = new Command();
content.ctype = "information";
content.AddContent("username", username);
message.content = content;
connection.Write(message);
Logger.log("Messenger: Requesting information for chat.", Logger.Verbosity.moderate);
this.SendUINotice("Requesting information.");
}
示例3: RequestKey
private void RequestKey(string username)
{
Message message = new Message();
message.type = Message.Type.UserToServerPlugin;
message.creator_plugin_hash = this._hash_code;
message.destination_plugin_hash = this._server_cryptor_hash;
Command content = new Command();
content.ctype = "publickey";
content.AddContent("username", username);
message.content = content;
this._controller.connection.Write(message);
Logger.log("Sent request for "+username+"'s publickey.", Logger.Verbosity.moderate);
}