欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

vbnet加密登陸 vb設(shè)置密碼登錄界面

VB點(diǎn)虐 如何實(shí)現(xiàn)記住密碼 自動(dòng)登錄

代碼如下:

成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),隰縣企業(yè)網(wǎng)站建設(shè),隰縣品牌網(wǎng)站建設(shè),網(wǎng)站定制,隰縣網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,隰縣網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

/// summary

/// 連接到窗體:通過密碼保護(hù)信息找回密碼!

/// /summary

/// param name="sender"/param

/// param name="e"/param

private void lbl_mibao_Click(object sender, EventArgs e)

{

Getbackpwd getbackpwd = new Getbackpwd();

getbackpwd.Show();

}

/// summary

/// 當(dāng)該窗體加載時(shí)從xml文件中讀取用戶信息并加載到combox的Items中

/// /summary

/// param name="sender"/param

/// param name="e"/param

private void Addresslist_Load(object sender, EventArgs e)

{

XmlTextReader reader = new XmlTextReader(@"E:\面向?qū)ο?-C#練習(xí)\通訊錄\address list\address list\user.xml");

while (reader.Read())

{

//if (reader.LocalName.Equals("Name") || reader.LocalName.Equals("Number"))

if (reader.LocalName.Equals("username"))

{

this.cmbUserName.Items.Add(reader.ReadString());

}

//if (reader.LocalName.Equals("Number"))

//{

// this.label2.Text += reader.ReadString() + "\n";\

//}

}

reader.Close();

}

/// summary

/// 保存用戶名到user.xml

/// /summary

//在listcontol上更改SelectedValue時(shí)執(zhí)行從數(shù)據(jù)庫讀取密碼的事件

private void cmbUserName_SelectedValueChanged(object sender, EventArgs e)

{

string username = cmbUserName.Text.Trim();

string sql = string.Format("select pwd from Admin where Username='{0}'", username);

try

{

SqlCommand command = new SqlCommand(sql, DBHelper.connection);

DBHelper.connection.Open();

SqlDataReader dataReader = command.ExecuteReader();

while (dataReader.Read())

{

txtpwd.Text = (string)dataReader["pwd"];

checkBoxpwd.Checked = true;

}

}

catch

{

MessageBox.Show("數(shù)據(jù)庫操作出錯(cuò)!");

}

finally

{

DBHelper.connection.Close();

}

}

/// summary

/// 記住密碼操作

/// /summary

/// param name="sender"/param

/// param name="e"/param

private void checkBoxpwd_Enter(object sender, EventArgs e)

{

bool check = true;

check = checkinput(cmbUserName.Text.Trim());

if ((string)cmbUserName.Text.Trim() == "")

{

MessageBox.Show("請(qǐng)輸入用戶名", "輸入提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

cmbUserName.Focus();

}

else

{

if (txtpwd.Text.Trim() == "")

{

MessageBox.Show("請(qǐng)輸入密碼", "輸入提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

txtpwd.Focus();

}

else

{

bool isValidUser = false; // 標(biāo)識(shí)是否為合法用戶

string message = ""; // 如果登錄失敗,顯示的消息提示

// 如果驗(yàn)證通過,就顯示相應(yīng)的用戶窗體,并將當(dāng)前窗體設(shè)為不可見

if (ValidateInput())

{

// 調(diào)用用戶驗(yàn)證方法

isValidUser = ValidateUser(cmbUserName.Text, txtpwd.Text, ref message);

// 如果是合法用戶,顯示相應(yīng)的窗體

if (isValidUser)

{

if (check == true)

{

XmlDocument doc = new XmlDocument();

doc.Load(@"E:\面向?qū)ο?-C#練習(xí)\通訊錄\address list\address list\user.xml");//(@"E:\面向?qū)ο?-C#練習(xí)\通訊錄\address list\address list\user.xml");

XmlElement node = doc.CreateElement("user");

XmlNode xnode = (XmlNode)doc.CreateElement("username");

xnode.InnerText = cmbUserName.Text.Trim();

node.AppendChild(xnode);

doc.DocumentElement.InsertAfter(node, doc.DocumentElement.LastChild);

doc.Save(@"E:\面向?qū)ο?-C#練習(xí)\通訊錄\address list\address list\user.xml");

//doc.Load (@"E:\面向?qū)ο?-C#練習(xí)\通訊錄\address list\address list\user.xml");

}

}

// 如果登錄失敗,顯示相應(yīng)的消息

else

{

MessageBox.Show(message, "記住密碼失敗!", MessageBoxButtons.OK, MessageBoxIcon.Information);

}

}

}

}

}

/// summary

/// 驗(yàn)證當(dāng)前combox中內(nèi)容是否已經(jīng)存在于xml文件中

/// /summary

/// param name="text"/param

/// returns/returns

private bool checkinput(string text)

{

int count;

bool c = true;

for (count = 0; count cmbUserName.Items.Count;count ++ )

{

if (text ==(string )cmbUserName .Items [count])

{

c=false;

}

}

return c;

}

xml文件內(nèi)容如下:?xml version="1.0" encoding="utf-8"?

person

user

VB.NET怎么登錄帶用戶名和密碼的服務(wù)器,鏈接數(shù)據(jù)庫?

做不到,access數(shù)據(jù)庫是本地?cái)?shù)據(jù)庫,不支持網(wǎng)絡(luò)訪問,建議你換成sql server或者mysql之類的數(shù)據(jù)庫。

注:如果一定要遠(yuǎn)程訪問access也不是不行,有兩種辦法,一個(gè)是服務(wù)器如果跟你在同一個(gè)局域網(wǎng),可以把數(shù)據(jù)庫文件夾共享出來,當(dāng)做共享文件訪問。另一種是在那臺(tái)服務(wù)器上裝個(gè)sql server數(shù)據(jù)庫,sql server可以創(chuàng)建出鏈接數(shù)據(jù)庫鏈接到那個(gè)access.

VB.NET程序加密問題

在FormLoad事件里,寫如下代碼:

If MsgBox("是否打開程序?", MsgBoxStyle.OkCancel) = MsgBoxResult.Cancel Then

End

End If

大概方法是這樣,要想加密碼的話,將MsgBox()換成你自己寫的對(duì)話框。

如果還嫌不夠具體的話,你這點(diǎn)兒分就不夠。。。

網(wǎng)頁題目:vbnet加密登陸 vb設(shè)置密碼登錄界面
標(biāo)題來源:http://chinadenli.net/article8/ddeojop.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)、商城網(wǎng)站、定制網(wǎng)站、小程序開發(fā)、網(wǎng)站導(dǎo)航網(wǎng)站設(shè)計(jì)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)