private void btnLogin_Click(object sender, EventArgs e) { string str = ""; string str2 = ""; if (StringType.StrCmp(this.cboUserName.Text, "", false) == 0) { OMISFunction.MessageboxInfo("请选择要登录的用户名 !", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.cboUserName.Focus(); return; } else { str3 = Strings.Mid(this.cboUserName.Text, Strings.InStr(this.cboUserName.Text, "=", CompareMethod.Text) + 1); str = Strings.Trim(Strings.Mid(this.cboUserName.Text, 1, Strings.InStr(this.cboUserName.Text, "=", CompareMethod.Text) - 1))
; string strSql = "select ID from view_user where ID= " + str3; try { //这里省略验证过程 } catch (Exception exception1) { ProjectData.SetProjectError(exception1)
; Exception exception = exception1; Debug.WriteLine(Information.Err().Description); ProjectData.ClearProjectError(); } } }这是我写的程序里的一部分。没有贴全,特别是验证部分。