人机交互用户界面设计实验报告.docx

上传人:b****2 文档编号:12878466 上传时间:2023-04-22 格式:DOCX 页数:22 大小:80.01KB
下载 相关 举报
人机交互用户界面设计实验报告.docx_第1页
第1页 / 共22页
人机交互用户界面设计实验报告.docx_第2页
第2页 / 共22页
人机交互用户界面设计实验报告.docx_第3页
第3页 / 共22页
人机交互用户界面设计实验报告.docx_第4页
第4页 / 共22页
人机交互用户界面设计实验报告.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

人机交互用户界面设计实验报告.docx

《人机交互用户界面设计实验报告.docx》由会员分享,可在线阅读,更多相关《人机交互用户界面设计实验报告.docx(22页珍藏版)》请在冰豆网上搜索。

人机交互用户界面设计实验报告.docx

人机交互用户界面设计实验报告

人机交互用户界面设计实验报告

D

usingSystem.Data.OleDb;

//Downloadby

namespaceWealthMIS.user

{

///

///Form1的摘要说明。

///

publicclassLogin:

System.Windows.Forms.Form

{

privateSystem.Windows.Forms.ButtonbtClose;

privateSystem.Windows.Forms.TextBoxpassword;

privateSystem.Windows.Forms.Labellabel3;

privateSystem.Windows.Forms.Labellabel2;

privateSystem.Windows.Forms.Labellabel1;

privateSystem.Windows.Forms.ComboBoxcomboName;

///

///必需的设计器变量。

///

privateSystem.ComponentModel.Containercomponents=null;

privateSystem.Windows.Forms.ButtonbtSure;

privateOleDbConnectionoleConnection1=null;

publicLogin()

{

//

//Windows窗体设计器支持所必需的

//

InitializeComponent();

//

//TODO:

在InitializeComponent调用后添加任何构造函数代码

//

}

///

///清理所有正在使用的资源。

///

protectedoverridevoidDispose(booldisposing)

{

if(disposing)

{

if(components!

=null)

{

components.Dispose();

}

}

base.Dispose(disposing);

}

#regionWindows窗体设计器生成的代码

///

///设计器支持所需的方法-不要使用代码编辑器修改

///此方法的内容。

///

privatevoidInitializeComponent()

{

System.ComponentModel.ComponentResourceManagerresources=newSystem.ComponentModel.ComponentResourceManager(typeof(Login));

this.btClose=newSystem.Windows.Forms.Button();

this.btSure=newSystem.Windows.Forms.Button();

this.password=newSystem.Windows.Forms.TextBox();

this.label3=newSystem.Windows.Forms.Label();

this.label2=newSystem.Windows.Forms.Label();

this.label1=newSystem.Windows.Forms.Label();

boName=newSystem.Windows.Forms.ComboBox();

this.SuspendLayout();

//

//btClose

//

this.btClose.FlatStyle=System.Windows.Forms.FlatStyle.Popup;

this.btClose.ForeColor=System.Drawing.Color.Black;

this.btClose.Location=newSystem.Drawing.Point(159,220);

this.btClose.Name="btClose";

this.btClose.Size=newSystem.Drawing.Size(75,23);

this.btClose.TabIndex=27;

this.btClose.Text="取消";

this.btClose.Click+=newSystem.EventHandler(this.btClose_Click);

//

//btSure

//

this.btSure.FlatStyle=System.Windows.Forms.FlatStyle.Popup;

this.btSure.ForeColor=System.Drawing.Color.Black;

this.btSure.Location=newSystem.Drawing.Point(46,220);

this.btSure.Name="btSure";

this.btSure.Size=newSystem.Drawing.Size(75,23);

this.btSure.TabIndex=26;

this.btSure.Text="确定";

this.btSure.Click+=newSystem.EventHandler(this.btSure_Click);

//

//password

//

this.password.BorderStyle=System.Windows.Forms.BorderStyle.FixedSingle;

this.password.Location=newSystem.Drawing.Point(130,136);

this.password.Name="password";

this.password.PasswordChar='*';

this.password.Size=newSystem.Drawing.Size(100,21);

this.password.TabIndex=25;

this.password.Text="admin";

//

//label3

//

this.label3.Font=newSystem.Drawing.Font("宋体",10.5F,System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point,((byte)(134)));

this.label3.ForeColor=System.Drawing.Color.Black;

this.label3.Location=newSystem.Drawing.Point(66,136);

this.label3.Name="label3";

this.label3.Size=newSystem.Drawing.Size(56,23);

this.label3.TabIndex=23;

this.label3.Text="密码";

//

//label2

//

this.label2.Font=newSystem.Drawing.Font("宋体",10.5F,System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point,((byte)(134)));

this.label2.ForeColor=System.Drawing.Color.Black;

this.label2.Location=newSystem.Drawing.Point(66,96);

this.label2.Name="label2";

this.label2.Size=newSystem.Drawing.Size(56,23);

this.label2.TabIndex=22;

this.label2.Text="用户名";

//

//label1

//

this.label1.Font=newSystem.Drawing.Font("楷体",18F,System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point,((byte)(134)));

this.label1.ForeColor=System.Drawing.Color.Black;

this.label1.Location=newSystem.Drawing.Point(42,48);

this.label1.Name="label1";

this.label1.Size=newSystem.Drawing.Size(208,28);

this.label1.TabIndex=21;

this.label1.Text="理财管理信息系统";

//

//comboName

//

boName.Location=newSystem.Drawing.Point(130,96);

boName.Name="comboName";

boName.Size=newSystem.Drawing.Size(104,20);

boName.TabIndex=28;

//

//Login

//

this.AutoScaleBaseSize=newSystem.Drawing.Size(6,14);

this.BackColor=System.Drawing.Color.SeaShell;

this.BackgroundImage=((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));

this.ClientSize=newSystem.Drawing.Size(298,287);

this.Controls.Add(boName);

this.Controls.Add(this.btClose);

this.Controls.Add(this.btSure);

this.Controls.Add(this.password);

this.Controls.Add(this.label3);

this.Controls.Add(this.label2);

this.Controls.Add(this.label1);

this.MaximizeBox=false;

this.MinimizeBox=false;

this.Name="Login";

this.StartPosition=System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text="登录";

this.Load+=newSystem.EventHandler(this.Login_Load);

this.ResumeLayout(false);

this.PerformLayout();

}

#endregion

///

///应用程序的主入口点。

///

[STAThread]

staticvoidMain()

{

Application.Run(newMainForm());

}

privatevoidbtSure_Click(objectsender,System.EventArgse)

{

try

{

stringsql="selectuName,PWDfromfamilywhereuName='"+boName.Text+"'";

if(oleConnection1==null)

oleConnection1=MainForm.getConnection();

OleDbCommandcmd=oleConnection1.CreateCommand();

cmd.CommandText=sql;

OleDbDataReaderdr=cmd.ExecuteReader();

if(!

dr.Read())

{

MessageBox.Show("无此用户,请重试!

","提示");

dr.Close();

cmd.Dispose();

return;

}

else

{

if(!

dr.GetString

(1).Equals(this.password.Text.ToString()))

{

MessageBox.Show("\n密码错误,请重试!

","提示");

dr.Close();

cmd.Dispose();

return;

}

Menumainmenu=((MainForm)(this.MdiParent)).getMainMenu();

for(inti=0;i<6;i++)

{

mainmenu.MenuItems[i].Visible=true;

}

StatusBarstatusBar=((MainForm)(this.MdiParent)).getStatusBar();

statusBar.Panels[0].Text="当前登录用户";

statusBar.Panels[1].Text=boName.Text.Trim();

statusBar.Panels[2].Text=DateTime.Now.ToString();

statusBar.Panels[3].Text="理财管理信息系统";

dr.Close();

cmd.Dispose();

this.Close();

}

}

catch(Exceptionee)

{

MessageBox.Show("\n"+ee.ToString());

}

}

privatevoidbtClose_Click(objectsender,System.EventArgse)

{

this.Close();

}

privatevoidLogin_Load(objectsender,System.EventArgse)

{

if(oleConnection1==null)

oleConnection1=MainForm.getConnection();

//取出系统的所有用户名

//显示在下拉列表,这样用户登录的时候

//选择用户名就可以了,不用再输入用户名了

stringsql="selectuNamefromfamily";

OleDbCommandcmd=newOleDbCommand(sql,oleConnection1);

OleDbDataReaderdr=cmd.ExecuteReader();

intflag=0;

while(dr.Read())

{

boName.Items.Add(dr.GetString(0));

flag++;

}

//如果系统存在用户,则默认选中第一个用户

if(flag>0)

boName.SelectedIndex=0;

dr.Close();

cmd.Dispose();

}

}

}

主界面:

usingSystem;

usingSystem.Drawing;

usingSystem.Collections;

usingSystem.ComponentModel;

usingSystem.Windows.Forms;

usingSystem.Data;

usingSystem.Data.OleDb;

//Downloadby

namespaceWealthMIS.user

{

///

///Form1的摘要说明。

///

publicclassLogin:

System.Windows.Forms.Form

{

privateSystem.Windows.Forms.ButtonbtClose;

privateSystem.Windows.Forms.TextBoxpassword;

privateSystem.Windows.Forms.Labellabel3;

privateSystem.Windows.Forms.Labellabel2;

privateSystem.Windows.Forms.Labellabel1;

privateSystem.Windows.Forms.ComboBoxcomboName;

///

///必需的设计器变量。

///

privateSystem.ComponentModel.Containercomponents=null;

privateSystem.Windows.Forms.ButtonbtSure;

privateOleDbConnectionoleConnection1=null;

publicLogin()

{

//

//Windows窗体设计器支持所必需的

//

InitializeComponent();

//

//TODO:

在InitializeComponent调用后添加任何构造函数代码

//

}

///

///清理所有正在使用的资源。

///

protectedoverridevoidDispose(booldisposing)

{

if(disposing)

{

if(components!

=null)

{

components.Dispose();

}

}

base.Dispose(disposing);

}

#regionWindows窗体设计器生成的代码

///

///设计器支持所需的方法-不要使用代码编辑器修改

///此方法的内容。

///

privatevoidInitializeComponent()

{

System.ComponentModel.ComponentResourceManagerresources=newSystem.ComponentModel.ComponentResourceManager(typeof(Login));

this.btClose=newSystem.Windows.Forms.Button();

this.btSure=newSystem.Windows.Forms.Button();

this.password=newSystem.Windows.Forms.TextBox();

this.label3=newSystem.Windows.Forms.Label();

this.label2=newSystem.Windows.Forms.Label();

this.label1=newSystem.Windows.Forms.Label();

boName=newSystem.Windows.Forms.ComboBox();

this.SuspendLayout();

//

//btClose

//

this.btClose.FlatStyle=System.Windows.Forms.FlatStyle.Popup;

this.btClose.ForeColor=System.Drawing.Color.Black;

this.btClose.Location=newSystem.Drawing.Point(159,220);

this.btClose.Name="btClose";

this.btClose.Size=newSystem.Drawing.Size(75,23);

this.btClose.TabIndex=27;

this.btClose.Text="取消";

this.btClose.Click+=newSystem.EventHandler(this.btClose_Click);

//

//btSure

//

this.btSure.FlatStyle=System.Windows.Forms.FlatStyle.Popup;

this.btSure.ForeColor=System.Drawing.Color.Black;

this.btSure.Location=newSystem.Drawing.Poi

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 教学研究 > 教学案例设计

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1