資源簡介
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace 圖書管理系統
{
public partial class 登錄窗口 : Form
{
//public static string ConnectionString = "Server=(local);database=圖書管理庫;uid=sa;pwd=1234"; //sql server 混合模式
// public static string ConnectionString = "Server=(local);Integrated Security=SSPI;database=圖書管理庫"; //windows模式
public string strSQL;
public SqlConnection myConnection;
public SqlCommandBuilder sqlCmdBld;
public DataSet ds = new DataSet();
public SqlDataAdapter da;
public int num=0;
private DataTable myTable;
private DataRow myRow;
public static string strUser;
public static string strPassword;
// public static string strDepartment;
public static bool login_flag = false;
public 登錄窗口()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void 登錄窗口_Load(object sender, EventArgs e)
{
linkdatabase link = new linkdatabase(); //實例化
myConnection = new SqlConnection(link.connectionstring()); //實例化連接
strSQL = "select * from 用戶表 ";
da = new SqlDataAdapter(strSQL, myConnection);
ds.Clear();
da.Fill(ds, "用戶表"); //////動作
myTable = ds.Tables["用戶表"];
for (int i = 0; i < myTable.Rows.Count; i++)
{
comboBox1.Items.Add(myTable.Rows[i]["用戶名"].ToString().Trim());
}
}
private void button1_Click(object sender, EventArgs e)
{
linkdatabase link = new linkdatabase(); //實例化
myConnection = new SqlConnection(link.connectionstring()); //實例化連接
strSQL = "sele

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Security.Cryptography;
namespace?圖書管理系統
{
????class?crypt
????{
????????//此處定義靜態類Jiami
????????//key為加密密匙可定期任意修改
????????private?const?string?key?=?“ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz“;
????????//?EnCode為字符串加密函數str為待加密的字符串,返回值為加密后的字符串
????????public?string?EnCode(string?str)
????????{
????????????if?(string.IsNullOrEmpty(str))
????????????{
????????????????return?““;
????????????}
????????????byte[]?buff?=?Encoding.Default.GetBytes(str);
????????????int?j?k?m;
????????????int?len?=?key.Length;
????????????StringBuilder?sb?=?new?StringBuilder();
????????????Random?r?=?new?Random();
????????????for?(int?i?=?0;?i?????????????{
????????????????j?=?(byte)r.Next(6);
????????????????buff[i]?=?(byte)((int)buff[i]?^?j);
????????????????k?=?(int)buff[i]?%?len;
????????????????m?=?(int)buff[i]?/?len;
????????????????m?=?m?*?8?+?j;
????????????????sb.Append(key.Substring(k?1)?+?key.Substring(m?1));
????????????}
????????????return?sb.ToString();
????????}
????????//?DeCode為字符串解密函數str為待解密的字符串,返回值為解密后的字符串
????????public?string?DeCode(string?str)
????????{
????????????if?(string.IsNullOrEmpty(str))
????????????{
????????????????return?““;
????????????}
????????????try
????????????{
????????????????int?j?k?m?n?=?0;
????????????????int?len?=?key.Length;
????????????????byte[]?buff?=?new?byte[str.Length?/?2];
????????????????for?(int?i?=?0;?i?????????????????{
????????????????????k?=?key.IndexOf(str[i]);
????????????????????m?=?key.IndexOf(str[i?+?1]);
????????????????????j?=?m?/?8;
????????????????????m?=?m?-?j?*?8;
????????????????????buff[n]?=?(byte)(j?*?len?+?k);
????????????????????buff[n]?=?(byte)((int)buff[n]?^?m);
????????????????????n++;
????????????????}
????????????????return?Encoding.Default.GetString(buff);
????????????}
????????????catch
????????????{
????????????????return?““;
????????????}
????????}
???
????//***************?不可逆轉??MD5加密
????????????public?string?SetEncrypt(string?text)
????????????{
????????????????if?(text?==?““)
????????????????{
????????????????????return?““;
????????????????}
????????????????MD5CryptoServiceProvider?md5?=?new?MD5CryptoServiceProvider();
????????????????string?cryptText?=?BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(text))?6?8);
????????????????
????????????????return?cryptText;
????????????}
?}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????277504??2011-05-18?15:20??圖書管理系統\C#實訓報告.doc
?????文件??????79287??2011-05-16?12:41??圖書管理系統\image\12Z041E4W0-39544.jpg
?????文件???????4431??2010-12-14?10:48??圖書管理系統\image\14402917.jpg
?????文件??????38614??2011-05-15?14:51??圖書管理系統\image\2.jpg
?????文件?????184671??2011-05-16?12:43??圖書管理系統\image\2008082516132307.jpg
?????文件?????131258??2011-05-30?20:07??圖書管理系統\image\2008128214935601_2.jpg
?????文件?????134649??2011-05-16?12:41??圖書管理系統\image\20081512123403_2.jpg
?????文件??????26749??2010-12-14?10:48??圖書管理系統\image\273ff9c79547fb14b319a8a3.jpg
?????文件??????91417??2011-05-15?14:59??圖書管理系統\image\3.jpg
?????文件??????36063??2010-12-14?10:41??圖書管理系統\image\431ae67a90f594790cd7daa1.jpg
?????文件?????163142??2011-05-16?12:43??圖書管理系統\image\4550-1.jpg
?????文件??????63051??2010-12-14?10:51??圖書管理系統\image\674c15ad70523ebd1e17a2a1.jpg
?????文件??????92199??2011-05-15?15:20??圖書管理系統\image\無標題.jpg
?????文件????3145728??2011-05-18?15:39??圖書管理系統\圖書管理庫.mdf
?????文件????1048576??2011-05-18?15:39??圖書管理系統\圖書管理庫_log.ldf
?????文件????????457??2011-05-01?15:08??圖書管理系統\圖書管理系統\app.config
?????文件????3245568??2011-06-17?12:40??圖書管理系統\圖書管理系統\bin\Debug\圖書管理系統.exe
?????文件????????457??2011-05-01?15:08??圖書管理系統\圖書管理系統\bin\Debug\圖書管理系統.exe.config
?????文件?????275968??2011-06-17?12:40??圖書管理系統\圖書管理系統\bin\Debug\圖書管理系統.pdb
?????文件??????14328??2011-05-18?15:38??圖書管理系統\圖書管理系統\bin\Debug\圖書管理系統.vshost.exe
?????文件????????457??2011-05-01?15:08??圖書管理系統\圖書管理系統\bin\Debug\圖書管理系統.vshost.exe.config
?????文件????????490??2007-07-21?01:33??圖書管理系統\圖書管理系統\bin\Debug\圖書管理系統.vshost.exe.manifest
?????文件???????2762??2011-05-01?15:08??圖書管理系統\圖書管理系統\Class1.cs
?????文件???????5303??2011-05-17?09:59??圖書管理系統\圖書管理系統\crp_入庫報表.cs
?????文件??????16384??2011-05-17?09:59??圖書管理系統\圖書管理系統\crp_入庫報表.rpt
?????文件???????6033??2011-05-01?15:08??圖書管理系統\圖書管理系統\crp_分類入庫報表.cs
?????文件??????16384??2011-05-01?15:08??圖書管理系統\圖書管理系統\crp_分類入庫報表.rpt
?????文件?????127269??2011-05-01?15:08??圖書管理系統\圖書管理系統\DataSet1.Designer.cs
?????文件????????361??2011-05-01?15:08??圖書管理系統\圖書管理系統\DataSet1.xsc
?????文件??????38961??2011-05-01?15:08??圖書管理系統\圖書管理系統\DataSet1.xsd
............此處省略109個文件信息
- 上一篇:RFID倉儲管理系統
- 下一篇:C#抽獎
評論
共有 條評論