導航:首頁 > 萬維百科 > vb設計網站注冊與登錄

vb設計網站注冊與登錄

發布時間:2020-12-29 21:13:36

1、VB設計一個登陸(注冊)界面

將以下代碼復制到Form1.frm中,然後用vb打開Form1.frm。
』代碼開始
VERSION
5.00
Begin
VB.Form
Form1
Caption
=
"Form1"
ClientHeight
=
1260
ClientLeft
=
60
ClientTop
=
345
ClientWidth
=
4065
LinkTopic
=
"Form1"
ScaleHeight
=
1260
ScaleWidth
=
4065
StartUpPosition
=
3
'窗口預設
Begin
VB.CommandButton
C1
Caption
=
"確定"
Height
=
495
Left
=
960
TabIndex
=
2
Top
=
480
Width
=
1815
End
Begin
VB.TextBox
T1
Height
=
270
Left
=
840
TabIndex
=
0
Top
=
120
Width
=
2895
End
Begin
VB.Label
Label1
AutoSize
=
-1
'True
BorderStyle
=
1
'Fixed
Single
Caption
=
"賬號:"
Height
=
240
Left
=
120
TabIndex
=
1
Top
=
120
Width
=
600
End
End
Attribute
VB_Name
=
"Form1"
Attribute
VB_GlobalNameSpace
=
False
Attribute
VB_Creatable
=
False
Attribute
VB_PredeclaredId
=
True
Attribute
VB_Exposed
=
False
Private
Sub
C1_Click()
Static
num
As
Integer
'定義靜態變數,儲存次數
If
T1
=
"abcd"
Then
'假設賬號為abcd
MsgBox
"登錄成功"
End
ElseIf
num
=
3
-
1
Then
MsgBox
"你無權使用本系統"
End
Else
MsgBox
"賬號錯誤,再次一次"
num
=
num
+
1
End
If
End
Sub
'代碼結束

2、vb設計用戶登陸的簡單界面

'Text1用來輸入密碼,Cmd1是「登錄」按鈕

Private Sub Cmd1_Click()
If UCase(Text1.Text) = "ABC" Then 』將text1中字母全變大寫再判斷
MsgBox "歡迎使用本系統內!"
Else
MsgBox "密碼錯誤,容請重新輸入!"
End If
End Sub

Private Sub Form_Load()
Text1.text = ""
Text1.PasswordChar = "*" 『使Text1中字元為*
End Sub

'大概就是這樣了。。。求分分~~

3、VB製作登錄以及注冊界面

呵呵。朋友是不是想要殺雞的先生也給你殺豬啊。VB製作的是獨立的應用程序,你不能把它當作別的什麼來用的。抱歉。我並不知道,你真正想怎麼做。

4、VB與Access設計登錄界面

你的conn雖然定義了,但是沒有打開,rs_login肯定open不了...
需要這樣:
conn.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\xxx.mdb;Jet OLEDB:Database Password=資料庫密碼"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic

當然連接字串中的數版據庫路權徑和密碼要改成你的...
祝你成功!

5、VB設計登錄程序,設計簡單的用戶登錄程序

Dim
AAA
As
String
Private
Sub
Command1_Click()
Dim
aa,
bb
aa
=
"admin"
'賬號
bb
=
"admin888"
'密碼復
AAA
=
Val(AAA)
+
1
'記錄登錄次數制
If
Val(AAA)
>=
3
Then
'等於大於3次,提示並退出程序
MsgBox
"你已經錯誤輸入三次!"
End
End
If
If
Text1
=
aa
And
Text2
=
bb
Then
'如果輸入正確
MsgBox
"登錄成功!"
Me.Hide
form2.Show
'登錄成功後,轉到form2界面
Else
'如果輸入錯誤
MsgBox
"賬號或密碼輸入錯誤!"
End
If
End
Sub
Private
Sub
Form_Load()
Label1
=
"歡迎光臨!"
End
Sub

6、VB製作一個簡單登錄頁面

那是肯定無法實現你說的置換的,你的值是保存在代碼里的,那就是固定的,即使你置換了,下次啟動程序又恢復到最初值了。要達到你說的置換,就需要使用文件來實現保存、置換更新等等功能。

7、VB登錄窗口製作代碼和流程

'主窗口為form2, form1為登陸窗口,上面有2個text、1個command控制項
Private Sub Command1_Click()
Static n
If Text1 = "119" Then
If Text2 = "911" Then
Form2.Show
Unload Me
Else
MsgBox "密碼錯誤!"
Text2 = ""
Text2.SetFocus
End If
Else
MsgBox "用戶名錯誤!"
Text1 = ""
Text1.SetFocus
End If
n = n + 1
If n = 3 Then Unload Me '錯誤次數3次
End Sub

8、用VB設計一個登陸界面,急!!!

Private Sub Command1_Click()
Static i As Integer
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "請輸入用戶名和密碼", vbOKOnly, "提示"
Text1.SetFocus
Exit Sub
End If
If Text1.Text = "admin" And Text2.Text = "admin" Then
MsgBox "用戶名密碼正確", vbOKOnly, "提示"
i = 0
Else
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus
If i < 3 Then
MsgBox "用戶名或密碼錯誤,請重新輸入", vbOKOnly, "提示"
i = i + 1
End If
If i = 3 Then
MsgBox "輸入3次錯誤用戶名或密碼,程序將退出", vbOKOnly, "提示"
Unload Me
End If
End If
End Sub
Private Sub Form_Load()
Label1.Caption = "用戶名"
Label2.Caption = "密 碼"
Text1.Text = ""
Text2.Text = ""
Text2.PasswordChar = "*"
Command1.Caption = "確定"
End Sub

9、怎樣用VB設計一個用戶注冊登錄系統

怎麼處理?當然是將用戶數據保存到資料庫中去啦!也可以保存到文本文件,看你 喜歡咯,既然不用代碼也沒什麼好說的

10、VB設計登錄程序,設計簡單的用戶登錄程序

Dim AAA As String
Private Sub Command1_Click()
Dim aa, bb
aa = "admin" '賬號
bb = "admin888" '密碼
AAA = Val(AAA) + 1 '記錄登錄次數
If Val(AAA) >= 3 Then '等於大於3次,提示並退出程序
MsgBox "你已經錯誤輸入三專次!"
End
End If
If Text1 = aa And Text2 = bb Then '如果輸入正確
MsgBox "登錄成功!屬"
Me.Hide
form2.Show '登錄成功後,轉到form2界面
Else '如果輸入錯誤
MsgBox "賬號或密碼輸入錯誤!"
End If
End Sub

Private Sub Form_Load()
Label1 = "歡迎光臨!"
End Sub

與vb設計網站注冊與登錄相關的知識