textBox的passwordChar设为*就可以了
在右边的属性框里有

解决方案 »

  1.   

    楼主啊,这个很简单啊
    你就用两个textbox,一个是用户ID,一个是密码框
    在登陆按钮里检查数据库里指定的用户id的密码和密码框里的是不是一样就好了阿
    没有技术难度阿,唯一要注意的是数据库里的密码需要加密,用varbinary数据类型,保存前加密,读出时解密。
      

  2.   

    string str = "Server = " + 服务器名";" + "user id = " + 用户名+";" +"initial catalog = master;"+ "password = " + 密码 +";"+ "Connection timeout = 8";
    SqlConnection Connec = new SqlConnection();
    SqlCommand Comman = new SqlCommand();
    Connec.ConnectionString = str;
    Comman.Connection = Connec;
    try
    {
    Connec.Open();
    }
    catch 
    {
    Connec.Close();
    MessageBox.Show("连接失败!","失败",MessageBoxButtons.OK ,MessageBoxIcon.Error);
    return;
    }命名空间上加上:
    using System.Data.SqlClient;
      

  3.   

    我知道了string source="server=hostlocal;uid=sa;pwd=;database=denglu";
    SqlConnection sqlConnection1=new SqlConnection (source) ;
    sqlConnection1.Open ();
    string select="select name from denglu  ";
      SqlCommand cmd= new SqlCommand (select,sqlConnection1);
    SqlDataReader reader=cmd.ExecuteReader ();if(reader.GetString (0)==textBox1.Text.ToString () )
    可这个判断语句不对啊,
    不知道怎样才能把数据从数据库中取出来了
      

  4.   

    这是连接SQLServer
    然后,你再得到用户名和密码,与数据库里面的比较。有的话,就提示成功,没有就提示失败。郁闷~~~~~~~~~~
      

  5.   

    我加了一个while(reader.Read())
    可还是运行不出来了,
    我实在想不出有什么好的方法了,