public void DiscussMessage(object sender, CQDiscussMessageEventArgs e) { InI ini = new InI(AppData.CQApi.AppDirectory + "main.ini"); Getjson gt = new Getjson(); string command = ini.ReadConfiguration("Command"); string str = e.Message.Text; int t = command.Length; int s = str.Length; if (t < s) { string left = str.Substring(0, t); if (left == command) { string a = ini.ReadConfiguration("AllUse"); string manager = ini.ReadConfiguration("Manager"); if (a == "false" | manager == e.FromQQ.ToString()) { string sending = gt.Get(str); AppData.CQApi.SendPrivateMessage(e.FromQQ, sending); } else { string sending = gt.Get(str); AppData.CQApi.SendPrivateMessage(e.FromQQ, sending); } } } }
public static void AppIni() { InI.filePath = InIPath; if (string.IsNullOrEmpty(InI.ReadValue("app", "svr"))) { InI.Writue("app", "svr", ""); } }
private void Login() { try { Cursor.Current = Cursors.WaitCursor; sa_t_operator_i oper = new sa_t_operator_i() { oper_id = this.txtOperId.Text, oper_pw = this.txtPwd.Text }; IBLL.IOper bll = new BLL.OperBLL(); if (bll.Login(oper)) { Program.oper = oper; InI.Writue("app", "oper_id", oper.oper_id); this.DialogResult = DialogResult.Yes; this.Close(); } else { new MsgForm("账号/密码错误").ShowDialog(); } } catch (Exception e) { LogHelper.writeLog("frmLogin", e.ToString()); MsgForm.ShowFrom(e); } finally { Cursor.Current = Cursors.Default; } }
private void frmLogin_Shown(object sender, EventArgs e) { this.txtOperId.Text = InI.ReadValue("app", "oper_id"); this.txtOperId.SelectionStart = this.txtOperId.TextLength; }