本文整理汇总了C#中Meebey.SmartIrc4net.IrcClient.RfcPart方法的典型用法代码示例。如果您正苦于以下问题:C# IrcClient.RfcPart方法的具体用法?C# IrcClient.RfcPart怎么用?C# IrcClient.RfcPart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meebey.SmartIrc4net.IrcClient
的用法示例。
在下文中一共展示了IrcClient.RfcPart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: command
public static void command(string[] args, string Channel, string Nick, IrcClient irc)
{
if (args.Length > 2) { irc.SendMessage(SendType.Message, Channel, String.Format("({0}) Usage: " + Program.GlobalVar.bot_comm_char + "part [#channel]", Nick)); }
else
{
string partChan = Channel;
bool chanCheck = false;
if (args.Length == 2) { partChan = args[1]; }
//make sure it is a valid channel
if (partChan.StartsWith("#"))
{
//make sure channel is in the database
MySqlCommand command = Program.GlobalVar.conn.CreateCommand();
command.CommandText = "SELECT Channel FROM channels WHERE Channel='" + partChan.ToLower() + "'";
try { Program.GlobalVar.conn.Open(); }
catch (Exception e) { Console.WriteLine(e.Message); }
MySqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
if (reader["Channel"].ToString() == partChan.ToLower())
{
chanCheck = true;
}
}
Program.GlobalVar.conn.Close();
if (chanCheck == false) { irc.SendMessage(SendType.Message, Channel, String.Format("I'm not in that channel sir")); }
else
{
command.CommandText = "DELETE FROM channels WHERE Channel='" + partChan.ToLower() + "'";
Program.GlobalVar.conn.Open();
command.ExecuteNonQuery();
Program.GlobalVar.conn.Close();
//Console message/info here
irc.SendMessage(SendType.Notice, Nick, String.Format("I am now leaving {0} sir", partChan));
irc.RfcPart(partChan);
}
}
else { irc.SendMessage(SendType.Message, Channel, String.Format("Please input a valid channel name sir")); }
}
}