日期:2014-05-17  浏览次数:20953 次

请问怎么在vs2008中做一个登陆界面
本人刚刚使用c#语言和vs2008,在做一个登陆界面,请各位大大帮忙,能具体的教一下怎么做这个登陆界面,现在我只知道拖动几个文本框,非常感谢各位大大!!

------解决方案--------------------

这个界面是我自己用VS2008中的C#编写的

------解决方案--------------------
校验码部分就是一个:
RandomDPRS.dll


接分中........

------解决方案--------------------
建议学习下基础 看两个这样的例子就明白啦 无非就是给按钮加图片 另外就是对用户名和密码等验证等等
------解决方案--------------------
跟你一个最简单的例子,没有连数据库。用户输入“nb”而且密码输入“nb”才能进去;
C# code

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;

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

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")//判断是否输入的用户名
            {
                MessageBox.Show("用户名不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (textBox1.Text.ToLower() == "nb" && textBox2.Text == "nb")//判断用户名和密码是否正确
                {
                    MessageBox.Show("登录成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    MessageBox.Show("用户名或密码错误!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = textBox2.Text = "";//清空文本框
        }
    }
}

------解决方案--------------------
探讨
这个界面是我自己用VS2008中的C#编写的

------解决方案--------------------
楼主找个现成小工程看看就好了。。。
------解决方案--------------------
www.ailaba.cn/login.aspx
我自己做的很简单的一个!喜欢的话找我要!
------解决方案--------------------
7楼写CS,我写ASPX,哈哈哈
<table>
<tr>
<td>用户名:〈/td>
<td><asp:Textbox runat="server" ID="textBox1"></asp:Textbox></td>
</tr>

<tr>
<td>密码:</td>
<td><asp:Textbox runat="server" ID="textBox2" TextMode="Password"></asp:Textbox></td>
</tr>

<tr>
<td></td>
<td>
<asp:Button runat="server" ID="Button1" OnClick="Button1_Click" text="登录"〉</asp:Button>&nbsp;&nbsp;
<asp:Button runat="server" ID="Button2" OnClick="Button2_Click" text="取消"〉</asp:Button>
</td>
</tr>
</table>
------解决方案--------------------
探讨
跟你一个最简单的例子,没有连数据库。用户输入“nb”而且密码输入“nb”才能进去;

C# code


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
……

------解决方案--------------------
一定要用验证码?简单一点的也可以用login控件!
探讨

跟你一个最简单的例子,没有连数据库。用户输入“nb”而且密码输入“nb”才能进去;
C# code

using System;
using System.Collections.Generic;