最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

VS2012實現(xiàn)簡單登錄界面

 更新時間:2018年06月05日 11:54:59   作者:Wu_zx520  
這篇文章主要為大家詳細介紹了VS2012實現(xiàn)簡單登錄界面,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了VS2012實現(xiàn)登錄界面的具體代碼,供大家參考,具體內(nèi)容如下

這個是第一個界面的代碼:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 登錄x
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }

    private void userInfoBindingNavigatorSaveItem_Click(object sender, EventArgs e)
    {
      this.Validate();
      this.userInfoBindingSource.EndEdit();
      this.tableAdapterManager.UpdateAll(this.studentRecordDataSet);

    }

    private void Form1_Load(object sender, EventArgs e)
    {
      // TODO: 這行代碼將數(shù)據(jù)加載到表“studentRecordDataSet1.UserInfo”中。您可以根據(jù)需要移動或刪除它。
      this.userInfoTableAdapter1.Fill(this.studentRecordDataSet1.UserInfo);
      // TODO: 這行代碼將數(shù)據(jù)加載到表“studentRecordDataSet.UserInfo”中。您可以根據(jù)需要移動或刪除它。
      this.userInfoTableAdapter.Fill(this.studentRecordDataSet.UserInfo);

    }

    private void passwordLabel_Click(object sender, EventArgs e)
    {

    }

    private void button1_Click(object sender, EventArgs e)
    {
      string connString = @"Data Source=.;Initial Catalog=studentrecord;Integrated Security=True";
      SqlConnection conn = new SqlConnection(connString);
      string sql = "select count(*) from UserInfo where username='" + userNameComboBox.Text + "'and password='" + passwordTextBox.Text + "'";
      conn.Open();
      SqlCommand comm = new SqlCommand(sql, conn);
      int num = (int)comm.ExecuteScalar();
      if (num > 0)
      {
        Form2 frm2 = new Form2();
        frm2.Show();

      }
      else
      {
        MessageBox.Show("對不起,用戶名和密碼并不匹配!", "登陸失敗");
      }
      conn.Close();
    }

    private void userNameComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {

    }

    private void passwordTextBox_TextChanged(object sender, EventArgs e)
    {

    }
  }
}

這個是第二個界面的代碼:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 登錄x
{
  public partial class Form2 : Form
  {
    public Form2()
    {
      InitializeComponent();
    }

    private void label1_Click(object sender, EventArgs e)
    {

    }
  }
}

運行結(jié)果如圖:

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

乌鲁木齐县| 阿克| 洞口县| 沛县| 理塘县| 寻乌县| 宝丰县| 松江区| 嫩江县| 太仆寺旗| 土默特左旗| 安仁县| 来安县| 赤城县| 格尔木市| 固原市| 茌平县| 顺平县| 海原县| 泰宁县| 彭阳县| 庆云县| 太白县| 平江县| 墨玉县| 绥芬河市| 蒲江县| 灵璧县| 福泉市| 卫辉市| 西畴县| 海门市| 邵阳市| 泾阳县| 灵寿县| 枞阳县| 襄城县| 巴塘县| 台中县| 界首市| 高青县|