//
// PassForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(194, 80);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.TB,
this.label1});
this.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "PassForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Security";
this.TopMost = true;
this.ResumeLayout(false);
this.DialogResult=DialogResult.No;
}
#endregion
private void TB_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if((int)e.KeyChar==(int)Keys.Enter)
{
string pass="";
pass=CommunicationLog.aaa.GetValue("aaa").ToString().ToLower();
if(pass==this.TB.Text.ToLower())
{
//CommunicationLog.Access=true;
r=DialogResult.Yes;
this.Dispose();
}
else {//MessageBox.Show("Access Denied");
r=DialogResult.No; this.Dispose();}
}
--------------------------------------------------------------------------------
PassForm P=new PassForm();
DialogResult r= P.ShowDialog();
if(r==DialogResult.Yes) MessageBox.Show(r+"");
else MessageBox.Show(r+"");