用户登录界面设计代码(用户登录界面设计代码是什么)

http://www.itjxue.com  2023-02-25 12:59  来源:未知  点击次数: 

html网页设计:一个简单的登录界面代码!

!doctype html

html

head

meta charset="utf-8"

link href="main.css" type="text/css" rel="stylesheet"

title登陆界面/title

/head

body

div class="login_ico"

img src="images/login_ico.png"

/div

div class="login_putin"

ul

liinput type="text" /li

liinput type="password" /li

/ul

/div

div class="login_btn"

input type="submit" value="登陆"

/div

/body

/html

样式 :

*{

margin:0;

padding:0;}

li{

list-style-type:none;

margin:0;

padding:0;}

a{

text-decoration:none;

color:#000;}

/*---------------------按钮-----------------------------*/

.login_putin ul li input{

margin: 0;

width:70%;

padding: 1em 2em 1em 5.4em;

-webkit-border-radius:.3em;

-moz-border-radius: .3em;

border: 1px solid #999;

}

.login_btn{

width:300px;

margin:40px auto 0 auto;

}

.login_btn input{

width:100%;

margin:0;

padding:.5em 0;

-webkit-border-radius:.3em;

-moz-border-radius: .3em;

border:#1263be solid 1px;

background:#1b85fd;

color:#FFF;

font-size:17px;

font-weight:bolder;

letter-spacing:1em;

}

.login_btn input:hover{

background:#1263be;

}

vb用户怎么登录界面?用户登陆的代码是多少?

vb登陆程序源代码\x0d\x0a\x0d\x0a你可以这样做建一个模块在里面输入下列\x0d\x0aPublic conn As ADODB.Connection\x0d\x0aSub main()\x0d\x0a Set conn = New ADODB.Connection\x0d\x0a conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;" _\x0d\x0a + "User ID=sa;password=sa;Initial Catalog=您的数据库名;Data Source=127.0.0.1"\x0d\x0a conn.Open\x0d\x0afrom1.Show ’登录界面\x0d\x0aEnd Sub\x0d\x0a\x0d\x0a再在登录界面“确定”下写入如下代码:\x0d\x0aPrivate Sub Command1_Click()\x0d\x0a If id.Text = "" Then\x0d\x0a MsgBox "用户名不能为空!", vbOKOnly + vbInformation, "友情提示"\x0d\x0a id.SetFocus\x0d\x0a Exit Sub\x0d\x0a End If\x0d\x0a If password.Text = "" Then\x0d\x0a MsgBox "密码不能为空!", vbOKOnly + vbInformation, "友情提示"\x0d\x0a password.SetFocus\x0d\x0a Exit Sub\x0d\x0a End If\x0d\x0a\x0d\x0a Dim strSQl As String\x0d\x0a strSQl = "select * from Users where users_name='" Trim$(id.Text) "' and password='" Trim$(password.Text) "' "\x0d\x0a \x0d\x0a Dim str As New ADODB.Recordset\x0d\x0a Set str = New ADODB.Recordset\x0d\x0a str.CursorLocation = adUseClient\x0d\x0a str.Open strSQl, conn, adOpenStatic, adLockReadOnly\x0d\x0a \x0d\x0a With str\x0d\x0a If .State = adStateOpen Then .Close\x0d\x0a .Open strSQl\x0d\x0a If .EOF Then\x0d\x0a Try_times = Try_times + 1\x0d\x0a If Try_times = 3 Then\x0d\x0a MsgBox "您已经三次尝试进入本系统,均不成功,系统将自动关闭", vbOKOnly + vbCritical, "警告"\x0d\x0a Unload Me\x0d\x0a Else\x0d\x0a MsgBox "对不起,用户名不存在或密码错误 !", vbOKOnly + vbQuestion, "警告"\x0d\x0a id.SetFocus\x0d\x0a id.Text = ""\x0d\x0a password.Text = ""\x0d\x0a End If\x0d\x0a Else\x0d\x0a \x0d\x0a Unload Me\x0d\x0a \x0d\x0a Form2.Show ’登录进入的另一个界面\x0d\x0a \x0d\x0a End If\x0d\x0a End With\x0d\x0a\x0d\x0aEnd Sub

关于VB设计中一个用户登录界面的代码

我好像看出来一点问题,,,

Adodc1.Recordset.Fields(1).Value对应是应该是数据库里的“密码”这个字段。

而你是用Adodc1.Recordset.Fields(1).Value

Combo1.Text

进行比较,肯定是比不来出什么正确的结果的,它俩天生就不相等。所以程序会继续向下运行。

用户名应该

对应Adodc1.Recordset.Fields(0).Value

VB设置用户和密码登录界面设计及代码 我是新手哦 先谢个

Const

Pwd="Admin"

Const

Usr="Admin"

加入两个文本框和一个按钮控件,2个文本框控件名分别为

UsrTxt

PwdTxt

按钮控件写代码:

if

UsrTxt

=

Usr

and

PwdTxt=Pwd

then

msgbox

"密码正确!",vbinformation,"提示"

else

msgbox

"密码错误!",vbinformation,"提示"

end

if

这是简单的密码登陆,通过更改常量在程序内部规定用户名和密码!其他的自己琢磨下或者给我发邮件

TimeDev@QQ.Com

JAVA中GUI登录界面设计源代码是什么?

import java.awt.BorderLayout;

import java.awt.Container;

import java.awt.FlowLayout;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JPasswordField;

import javax.swing.JTextField;

public class Login {

private JFrame frame = new JFrame("登录");

private Container c = frame.getContentPane();

private JTextField username = new JTextField();

private JPasswordField password = new JPasswordField();

private JButton ok = new JButton("确定");

private JButton cancel = new JButton("取消");

public Login(){

frame.setSize(300,200);

c.setLayout(new BorderLayout());

initFrame();

frame.setVisible(true);

}

private void initFrame() {

//顶部

JPanel titlePanel = new JPanel();

titlePanel.setLayout(new FlowLayout());

titlePanel.add(new JLabel("系统管理员登录"));

c.add(titlePanel,"North");

//中部表单

JPanel fieldPanel = new JPanel();

fieldPanel.setLayout(null);

JLabel l1 = new JLabel("用户名:");

l1.setBounds(50, 20, 50, 20);

JLabel l2 = new JLabel("密 码:");

l2.setBounds(50, 60, 50, 20);

fieldPanel.add(l1);

fieldPanel.add(l2);

username.setBounds(110,20,120,20);

password.setBounds(110,60,120,20);

fieldPanel.add(username);

fieldPanel.add(password);

c.add(fieldPanel,"Center");

//底部按钮

JPanel buttonPanel = new JPanel();

buttonPanel.setLayout(new FlowLayout());

buttonPanel.add(ok);

buttonPanel.add(cancel);

c.add(buttonPanel,"South");

}

public static void main(String[] args){

new Login();

}

}

javascript html 设计一个登录界面

注册页面代码:

!DOCTYPE?html

html?lang="en"

head

????meta?charset="UTF-8"

????title注册/title

/head

body

form?method="post"?onsubmit="return?false"?id="form"

????input?type="text"?name="username"?placeholder="用户名"br

????input?type="password"?name="password"?placeholder="密码"br

????input?type="password"?name="rePassword"?placeholder="再次输入密码"br

????input?type="submit"?onclick="register_user()"?value="注册"br

/form

a?href="login.html"去登录/a

script

????var?localDB?=?openDatabase('localDB',?'1.0',?'Test?DB',?2?*?1024?*?1024);

????localDB.transaction(function?(ts)?{

????????ts.executeSql('CREATE?TABLE?IF?NOT?EXISTS?user(username,password)')

????});

????function?register_user()?{

????????var?username?=?document.getElementsByTagName("input")[0].value;

????????var?password?=?document.getElementsByTagName("input")[1].value;

????????var?rePassword?=?document.getElementsByTagName("input")[2].value;

????????if(password?!=?rePassword)

????????{

????????????alert("两次输入的密码不同,请重新输入");

????????}else

?{

????????????localDB.transaction(function(ts){

????????????????ts.executeSql("INSERT?INTO?user?(username,password)?VALUES?('"+username+"','"+password+"');");

????????????????alert("注册成功");

????????????});

????????}

????}

/script

/body

/html

登录页面代码:

!DOCTYPE?html

html?lang="en"

head

????meta?charset="UTF-8"

????title登录/title

/head

body

form?onsubmit="return?false"?method="post"

????input?type="text"?placeholder="用户名"br

????input?type="password"?placeholder="密码"br

????input?type="submit"?value="登录"?onclick="login()"br

/form

a?href="register.html"去注册/a

script

????var?localDB?=?openDatabase('localDB',?'1.0',?'Test?DB',?2?*?1024?*?1024);

????localDB.transaction(function?(ts)?{

????????ts.executeSql("SELECT?*?FROM?user",[],function?(tx,?results)?{

????????????var?len?=?results.rows.length;

????????????if(len=0)

????????????{

????????????????localDB.transaction(function?(ts)?{

????????????????????ts.executeSql('CREATE?TABLE?IF?NOT?EXISTS?user(username,password)')

????????????????});

????????????}

????????});

????});

????function?login()?{

????????var?username?=?document.getElementsByTagName("input")[0].value;

????????var?password?=?document.getElementsByTagName("input")[1].value;

????????localDB.transaction(function?(ts)?{

????????????ts.executeSql("SELECT?*?FROM?user?WHERE?username='"+username+"';",[],function?(ts,?res)?{

????????????????if(res.rows.length=0)

????????????????{

????????????????????alert("登录失败,用户未注册");

????????????????}else?if?(password?==?res.rows[0].password)

????????????????{

????????????????????alert("登录成功,三秒后跳转到百度");

????????????????????setInterval(function?()?{

????????????????????????location.href?=?"";

????????????????????},3000);

????????????????}else

?{

????????????????????alert("登录失败,密码错误");

????????????????}

????????????});

????????})

????}

/script

/body

/html

以上代码使用了WEB SQL,还请选择合适的浏览器查看。

(责任编辑:IT教学网)

更多

推荐windows vista文章