private void secAddTxt(string s) { string mt = msg.Value; mt += ("\n" + s); msg.Value = MCWinControl.FormatStrAsLine(mt, 20); }
// 移除黑名单 void BtunbanClick(object sender, EventArgs e) { string uname = unbantext.Text; if (String.IsNullOrEmpty(uname)) { secAddTxt("空用户名"); return; } unbantext.Text = ""; secAddTxt(MCWinControl.unban(LAUNCHERNAME, uname)); }
// 移除白名单 void BtblackClick(object sender, EventArgs e) { string uname = blacktext.Text; if (String.IsNullOrEmpty(uname)) { secAddTxt("空用户名"); return; } blacktext.Text = ""; secAddTxt(MCWinControl.postLongCmd(LAUNCHERNAME, "whitelist remove \"" + uname + "\"")); }
// 发送消息 void BtcmdClick(object sender, EventArgs e) { string cmd = cmdtext.Text; if (String.IsNullOrEmpty(cmd)) { secAddTxt("空消息不予发送"); return; } cmdtext.Text = ""; secAddTxt(MCWinControl.postLongCmd(LAUNCHERNAME, cmd)); }
// 启动服务端 void StartServerClick(object sender, EventArgs e) { secAddTxt(MCWinControl.StartProc(LAUNCHERNAME, LAUNCHERPATH)); }
// 关服 void ShutdownClick(object sender, EventArgs e) { secAddTxt(MCWinControl.closeProc(LAUNCHERNAME)); }
// 显示后台 void ShowmcClick(object sender, EventArgs e) { secAddTxt(MCWinControl.getStrFromProc(LAUNCHERNAME)); }