㈠ 用户登录验证的代码怎么写

<br>
<%
//接受参数,request.getParameter("参数名称"),此方法返回String类型
String name = request.getParameter("username");
String password = request.getParameter("userpassword");
%>
<%
if(name.equals("handson")&&password.equals("handson")){
//合法用户
%>
<%@include file = "login_success.jsp" %>
<%
} else{
%>
<%@include file = "login_failure.jsp" %>
<%
}
%>
</center>

㈡ 汇编语言 密码验证代码怎么写

;密码验证代码
;
CODE SEGMENT
ASSUME CS:CODE,DS:CODE
start: MOV AX,CODE
MOV DS,AX
cld
AGAIN: MOV AX,3
INT 10H
lea dx,MENU ;主菜单
mov ah,9
int 21h
input:
mov ah,0
int 16h
cmp al,'1'
jnz cp2
call sub01 ;输入一个字符串
jmp AGAIN
cp2:cmp al,'2'
jnz cp3
call sub02 ;字符串左右移动
jc exit
jmp AGAIN ;返回到主菜单
cp3:cmp al,'3' ;返回DOS
jnz input
exit:
lea dx,MESG
mov ah,9
int 21h
mov ah,1
int 21h
MOV AH,4CH
INT 21H

sub01:
mov ax,3
int 10h
lea dx,tips
mov ah,9
int 21h
lea dx,msg1
mov ah,0ah
int 21h ;输入一个字符串
mov ax,0e0dh
int 10h
mov al,0ah
int 10h
ret

sub02:
mov ax,3
int 10h
clc
push ds
pop es
mov bp,3
sss:
lea dx,Pass
mov ah,9
int 21h
lea dx,msg2
mov ah,0ah
int 21h
lea si,buf1
lea di,buf2
mov ch,0
mov cl,msg1+1
cmp cl,msg2+1
jnz cuowu
repz cmpsb
jcxz right
cuowu:
lea dx,no
mov ah,9
int 21h
dec bp
jnz sss
stc
jmp ok
right:
lea dx,yes
mov ah,9
int 21h
ok:
mov ah,1
int 21h
ret

MENU DB 5 DUP(0AH)
DB 31 DUP(' '),'MAIN MENU',0DH,0AH
DB 25 DUP(' '),201,21 DUP(205),187,0DH,0AH
DB 25 DUP(' '),186,' 1.Shuru Mima',8 p (20h),186,0DH,0AH
DB 25 DUP(' '),186,' 2.Jiaoyan Mima',6 p (20h),186,0DH,0AH
DB 25 DUP(' '),186,' 3.Return to DOS ... ',186,0DH,0AH
DB 25 DUP(' '),200,21 DUP(205),188,0DH,0AH
DB 28 DUP(' '),'Choice(1,2,3):$'
MESG DB 0dh,0ah,0dh,0ah,9,'Press any key to exit ...$'
Pass db 0dh,0ah,9,'Enter your password: $'
yes db 0dh,0ah,9,'password correct$'
no db 0dh,0ah,9,'password error$'
tips db 0dh,0ah,9,'Input a string: $'
msg1 db 255,0
buf1 db 255 p(0)
msg2 db 255,0
buf2 db 255 p(0)

CODE ENDS
END start

php中验证账号密码的代码

<?php
session_start();
if($_POST['name']&&$_POST['pass'])
{
$name=$_POST['name']; //接受传递值
$pass=$_POST['pass'];
}
else
{
echo '用户名或密码不能为空';//当然也可以进行其他操作,比如使用header('Location:error.php')来把用户重定向到一个错误提示页
exit;
}
include_once('mysql_connect.php');//连接数据库

$name=mysql_real_escape_string($name); //过滤信息
$pass=mysql_real_escape_string($pass);
$sql='select username,userpass from userdata where username="$name"';//从数据库中取出用户信息
$r=mysql_query($sql);
if(mysql_num_rows==0)
{
echo '用户名不存在';
exit;
}
else
{
$row=mysql_fetch_assoc($r);
if($pass!=$row['userpass'])
{
echo '用户密码错误';
exit;
}
esle
{
$_SESSION['user']=$name; //创建SESSION
}
}
?>

html密码验证

用JS验证的?怎么验证的噢?你是说验证密码长度之类、 还是说登陆噢?

㈤ 如图,验证账号密码的VB代码怎么写呢

下面代码是我自己写的,自己做学生管理用到的。你可以借鉴一下。
ExecuteSQL是另外建的模块,另起回复。
Private Sub Cmd_ok_Click()
Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim UserName As String
miCount = miCount + 1
UserName = ""
If Trim(Txt_yhm.Text = "") Then
MsgBox "请输入用户名!", vbOKOnly + vbExclamation, "警告"
YZ = YZ + 1
Txt_yhm.SetFocus
Else
txtSQL = "select * from user_Info where user_ID = '" & Txt_yhm & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
YZ = YZ + 1
Txt_yhm.SetFocus
Else
If Trim(mrc.Fields(1)) = Trim(Txt_Mm.Text) Then
MFrm_Main.Show
OK = True
mrc.Close
Me.Hide
UserName = Trim(Txt_yhm.Text)
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
YZ = YZ + 1
Txt_Mm.SetFocus
Txt_Mm.Text = ""
End If
End If
End If
If miCount = 3 Then
If miCount = YZ Then
MsgBox "!", vbOKOnly + vbExclamation, "警告"
Me.Hide
Unload Me
Else
MFrm_Main.Show
End If
End If
Exit Sub
End Sub
------------------------------------------------------------------------------------------
Public FmainForm As MFrm_Main
Public UserName As String

Public Function ConnectString() As String
ConnectString = "FileDSN=student.dsn;UID=sa;PWD=19970807"
End Function

Sub main()
Dim flogin As New Frm_Login '显示登录船窗体实例
flogin.Show vbModal
If Not flogin.OK Then
End
End If
Unload flogin

Set FmainForm = New MFrm_Main
FmainForm.Show

End Sub

Public Function ExecuteSQL(ByVal SQL As String, MsgString As String) As ADODB.Recordset
'executes SQL and returns Recordset
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim sTokens() As String

'On Error GoTo ExecuteSQL_Error

sTokens = Split(SQL)
Set cnn = New ADODB.Connection
cnn.Open ConnectString

If InStr("INSERT,DELETE,UPDATE", UCase$(sTokens(0))) Then '非Select语句
cnn.ExecuteSQL '数据量不大时,可以在连接上,直接执行SQL语句
MsgString = sTokens(0) & " query successful"
'虽然MsgString不是返回值,但传递方式是ByRef,实参地址和这个地址相同
Else 'Select语句
Set rst = New ADODB.Recordset
rst.Open Trim$(SQL), cnn, adOpenKeyset, adLockOptimistic
'得到临时表,游标指向第一条记录
'get RecordCount,
Set ExecuteSQL = rst
MsgString = "查询到" & rst.RecordCount & _
" 条记录 "
End If

ExecuteSQL_Exit:
Set rst = Nothing
Set cnn = Nothing
Exit Function

'ExecuteSQL_Error:
MsgString = "查询错误: " & _
Err.Description
Resume ExecuteSQL_Exit
End Function

Public Function Testtxt(txt As String) As Boolean
If Trim(txt) = "" Then
Testtxt = False
Else
Testtxt = True
End If
End Function

㈥ 跪求一个:c语言密码验证程序的源代码

#include<stdio.h>
#include<conio.h>
#include<string.h>
char password[10]="hunter";
typedef struct
{
char data[6];
int top;
}stacktype;
void initstack(stacktype *s)
{
s->top=-1;
}
void push(stacktype *s,char x)
{
if(s->top==6)
printf( "stack is full");
else
{
s->top++;
s->data[s->top]=x;
}
}
int pop(stacktype *s)
{
if(s->top==-1) return(0);
else s->top--;return(1);
}
char stacktop(stacktype *s)
{
char x;
if(s->top==-10) return(0);
else x=s->data[s->top];return(x);
}
void programme(stacktype *s)
{
char a;
char b[5];
int i,j,c;
printf( "请输入一个六位数的密码,你只有三次机会:\n");
for(i=0;i<=2;i++)
{
for(j=0;j<=5;j++)
{
c=j;
a=getch();
if((int)a!=8)
{
printf( "*");
push(s,a);
}
else
{
printf("\b \b");
j=c-2;
pop(s);
}
}
for(j=5;j>=0;j--)
{
pop(s);
b[j]=stacktop(s);
}
b[6]='\0';
printf( "\n");
if(strcmp(password,b)==0)
{
printf( "密码正确\n");
break;
}
else
{
printf("密码错误,请再试一次!\n");
continue;
}
}
if(i==3)
printf("密码错误,即刻退出\n");
}
void main()
{
stacktype s;
initstack(&s);
programme(&s);
}
这是个范例,你自己研究研究

㈦ C#中验证账号密码的代码怎么写

<%
string username = "长沙极度信息"
string password = "0731icom"

string requestUsername = text1.value;
string requestPassword = text2.value;

if(requestUsername ==username && password ==requestPassword )
{
MessageBox.Show("用户名和密码验证成功!");
}
else
{
MessageBox.Show("用户名或密码不正确!");

}
%>

㈧ 谁能给一个网页验证密码登陆的代码

<html>
<head>
<title>恶搞网抄页</title>
<script language="vbscript">
sub button1_onclick
r=inputbox("请输入网页访问密码","密码输入框")
if r = "123456" then
window.location.replace("http://www..com")
else
msgbox "密码错误" ,vbcritical + vbokonly + vbdefautbutton1, "错误"
end if
end sub
</script>
</head>
<body>
<form><input name="button1" type="button" value="点击输入密码"></form>
</body>
</html>

照例多写几个,就可以登陆不同的网站了

㈨ 急求一个VB密码输入的验证程序编写代码!

刚刚写过了类似的代码,算了再写下

PrivateSubCommand1_Click()

StaticiAsInteger'说明下,假设用户名、密码分别是yutian8802和123456

Ifi>2Then

MsgBox"您已登录三次了。。。程序将结束!"

End

Else

IfText1.Text="yutian8802"Then

IfText2.Text="123456"Then

MsgBox"登陆成功"

Else

MsgBox"密码错,请重新输入!"

EndIf

Else

MsgBox"用户名错,请重新输入!"

EndIf

i=i+1

EndIf

EndSub

测试了没问题了你试试!有什么问题一起探讨~