91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 407KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-07-07
  • 語言: C#
  • 標簽:

資源簡介

簡單的登陸界面,用到了簡單的Access數據庫的鏈接;可以做學習用.大一時候課程設計也找過類似的程序,但是沒有滿意的,所以按照我的感覺為剛剛開始學習C#的同學做的. 這個小程序除了對登錄的用戶名和密碼進行匹配外,還對登錄的身份類型進行了判定;比如,如果是管理員身份則進入管理員界面;如果是普通用戶則進入普通用戶界面.

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Data.OleDb;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;

namespace?RG_Soft
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?button1_Click(object?sender?EventArgs?e)
????????{

????????}

????????private?void?button1_Click_1(object?sender?EventArgs?e)
????????{???
????????????string?reportPath?=?Application.StartupPath.Substring(0?Application.StartupPath.Substring(0?Application.StartupPath
????.LastIndexOf(“\\“)).LastIndexOf(“\\“));
????????????reportPath?+=?@“\db_RGS.mdb“;
????????????string?ConStr?=?“Provider=Microsoft.jet.OLEDB.4.0;Data?source=“?+?reportPath;
????????????//創建Connection?對象
????????????OleDbConnection?con?=?new?OleDbConnection(ConStr);
????????????con.Open();
????????????if?(con.State==ConnectionState.Open)
????????????{
?????????????????//MessageBox.Show(“數據庫鏈接成功!“?“鏈接“);
????????????????//判斷用戶名或密碼是否為空
????????????????if?(textBox1.Text?==?““?|?textBox2.Text?==?““)
????????????????{
????????????????????MessageBox.Show(“用戶名或密碼不能為空“?“警告“);
????????????????}
????????????????else
????????????????{???//進行身份認證
????????????????????string?tx?=?“select?count(*)?FROM?[user]?where?user_id=‘“?+?this.textBox1.Text?+?“‘?and?user_pwd=‘“?+?this.textBox2.Text?+?“‘“;
????????????????????OleDbCommand?cmd?=?new?OleDbCommand(txcon);
????????????????????Int32?id_e?=?(Int32)cmd.ExecuteScalar();
????????????????????if?(id_e?>?0)
????????????????????{???//判斷用戶權限
??????????????????????
????????????????????????//MessageBox.Show(“登錄成功““成功“);
???????????????????????string?sql?=?“select?user_type?from?[user]?where?user_id=‘“?+?this.textBox1.Text?+?“‘and?user_pwd=‘“?+?this.textBox2.Text?+?“‘“;

????????????????????????OleDbDataAdapter?da?=?new?OleDbDataAdapter(sqlcon);
????????????????????????DataSet?ds?=?new?DataSet();
????????????????????????da.Fill(ds);
???????????????????????
????????????????????????
????????????????????????this.textBox3.Text?=?ds.Tables[0].Rows[0][0].ToString();
????????????????????????if?(?this.textBox3.Text==?“0“)
????????????????????????{?MessageBox.Show(“普通身份登錄“?“登錄中“);?}
????????????????????????else?if?(this.textBox3.Text??==?“1“)
????????????????????????{?MessageBox.Show(“管理員身份登錄“?“登錄中“);?}
????????????????????????else
????????????????????????{MessageBox.Show(“數據庫內部錯誤“?“登錄中“);}
?????????????????????
????????????????????????con.Close();
????????????????????????cmd.Dispose();
????????????????????????

????????????????????}
????????????????????else
????????????????????{
????????????????????????MessageBox.Show(“用戶名或密碼不正確!“?“請重新登錄“);
????????????????????}
????????????????}
????????????}
????????????else
????????????{
????????????????MessageBox.Show(“數據庫鏈接失敗!“?“鏈接“);
????????????}
????????}
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????155648??2009-05-10?14:13??RG?Soft\RG?Soft\RG?Soft\bin\Debug\db_RGS.mdb

?????文件?????114688??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\bin\Debug\RG?Soft.exe

?????文件??????24064??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\bin\Debug\RG?Soft.pdb

?????文件???????5632??2005-11-11?22:25??RG?Soft\RG?Soft\RG?Soft\bin\Debug\RG?Soft.vshost.exe

?????文件?????155648??2009-05-10?15:00??RG?Soft\RG?Soft\RG?Soft\db_RGS.mdb

?????文件???????3089??2009-05-10?15:01??RG?Soft\RG?Soft\RG?Soft\Form1.cs

?????文件???????6749??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\Form1.Designer.cs

?????文件?????144159??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\Form1.resx

?????文件????????842??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\obj\Debug\RG?Soft.csproj.GenerateResource.Cache

?????文件?????114688??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\obj\Debug\RG?Soft.exe

?????文件??????24064??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\obj\Debug\RG?Soft.pdb

?????文件??????92517??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\obj\Debug\RG_Soft.Form1.resources

?????文件????????180??2009-05-09?17:12??RG?Soft\RG?Soft\RG?Soft\obj\Debug\RG_Soft.Properties.Resources.resources

?????文件????????290??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\obj\RG?Soft.csproj.FileList.txt

?????文件????????466??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\Program.cs

?????文件???????1172??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\Properties\AssemblyInfo.cs

?????文件???????2868??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\Properties\Resources.Designer.cs

?????文件???????5612??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\Properties\Resources.resx

?????文件???????1090??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\Properties\Settings.Designer.cs

?????文件????????249??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\Properties\Settings.settings

?????文件???????3365??2009-05-10?12:53??RG?Soft\RG?Soft\RG?Soft\RG?Soft.csproj

?????文件????????910??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft.sln

????..A..H.?????13312??2009-05-10?15:01??RG?Soft\RG?Soft\RG?Soft.suo

?????目錄??????????0??2009-05-09?17:05??RG?Soft\RG?Soft\RG?Soft\obj\Debug\Refactor

?????目錄??????????0??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\obj\Debug\TempPE

?????目錄??????????0??2009-05-10?12:53??RG?Soft\RG?Soft\RG?Soft\bin\Debug

?????目錄??????????0??2009-05-10?14:58??RG?Soft\RG?Soft\RG?Soft\obj\Debug

?????目錄??????????0??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\bin

?????目錄??????????0??2009-05-09?17:12??RG?Soft\RG?Soft\RG?Soft\obj

?????目錄??????????0??2009-05-09?16:47??RG?Soft\RG?Soft\RG?Soft\Properties

............此處省略6個文件信息

評論

共有 條評論

相關資源