3个回答
2013-07-27
展开全部
<!-- #include file="retop.asp" -->
<html>
<head>
<link rel="stylesheet" href="common.css" type="text/css">
<script language="vbscript">
<!--
Sub pass2_OnBlur
'判断两次密码是否相同
if formreg.pass1.value <> formreg.pass2.value then
document.formreg.elements(2).focus()
MsgBox"两次输入的密码不一致!"
end if
end Sub
Sub btnreg_OnClick
'判断用户名是否正确
if Trim(formreg.username.value)=Empty then
document.formreg.elements(0).focus()
MsgBox"用户名不能为空!"
exit Sub
else if len(formreg.username.value)>12 then
document.formreg.elements(0).focus()
MsgBox"用户名不能超过12个字符!"
exit Sub
end if
end if
'判断用户密码是否正确
if Trim(formreg.pass1.value)=Empty then
document.formreg.elements(1).focus()
MsgBox"密码不能为空!"
exit Sub
else if len(formreg.pass1.value)>12 then
document.formreg.elements(1).focus()
MsgBox"密码不能超过12个字符!"
exit Sub
end if
end if
formreg.Submit
end Sub
-->
</script>
<title>同学通讯录</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body>
<h4>请输入注册信息<h4>
<form method="post" name="formreg" action="register2.asp">
<p>用 户 名:<input type="text" name="username" size="12">
(<span class="STYLE1">* 必填,最长12个字符</span>)</p>
<p>用户密码:<input type="password" name="pass1" size="12">
(<span class="STYLE1">* 必填,最长12个字符</span>)</p>
<p>重输密码:<input type="password" name="pass2" size="12">
(<span class="STYLE1">* 必填,最后验证密码</span>)</p>
<p><input type="button" name="btnreg" value="确定">
<input type="reset" value="取消">
</p>
</form>
</body>
</html>
<html>
<head>
<link rel="stylesheet" href="common.css" type="text/css">
<script language="vbscript">
<!--
Sub pass2_OnBlur
'判断两次密码是否相同
if formreg.pass1.value <> formreg.pass2.value then
document.formreg.elements(2).focus()
MsgBox"两次输入的密码不一致!"
end if
end Sub
Sub btnreg_OnClick
'判断用户名是否正确
if Trim(formreg.username.value)=Empty then
document.formreg.elements(0).focus()
MsgBox"用户名不能为空!"
exit Sub
else if len(formreg.username.value)>12 then
document.formreg.elements(0).focus()
MsgBox"用户名不能超过12个字符!"
exit Sub
end if
end if
'判断用户密码是否正确
if Trim(formreg.pass1.value)=Empty then
document.formreg.elements(1).focus()
MsgBox"密码不能为空!"
exit Sub
else if len(formreg.pass1.value)>12 then
document.formreg.elements(1).focus()
MsgBox"密码不能超过12个字符!"
exit Sub
end if
end if
formreg.Submit
end Sub
-->
</script>
<title>同学通讯录</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body>
<h4>请输入注册信息<h4>
<form method="post" name="formreg" action="register2.asp">
<p>用 户 名:<input type="text" name="username" size="12">
(<span class="STYLE1">* 必填,最长12个字符</span>)</p>
<p>用户密码:<input type="password" name="pass1" size="12">
(<span class="STYLE1">* 必填,最长12个字符</span>)</p>
<p>重输密码:<input type="password" name="pass2" size="12">
(<span class="STYLE1">* 必填,最后验证密码</span>)</p>
<p><input type="button" name="btnreg" value="确定">
<input type="reset" value="取消">
</p>
</form>
</body>
</html>
2013-07-27
展开全部
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
End Sub
这个点登陆时链接的 其他的自己画
Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click
Dim oCmd As SqlClient.SqlCommand
Dim strConn As String
strConn &= "Data Source=(local);"
strConn &= "Initial Catalog=Northwind;"
strConn &= "User ID=sa;"
strConn &= "Password=1234;"
oCmd = New SqlClient.SqlCommand
oCmd.Connection = New SqlClient.SqlConnection(strConn)
oCmd.Connection.Open()
oCmd.CommandText = txtSQL.Text
txtRows.Text = oCmd.ExecuteNonQuery().ToString()
oCmd.Connection.Close()
End Sub
End Class
'在此处放置初始化页的用户代码
End Sub
这个点登陆时链接的 其他的自己画
Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click
Dim oCmd As SqlClient.SqlCommand
Dim strConn As String
strConn &= "Data Source=(local);"
strConn &= "Initial Catalog=Northwind;"
strConn &= "User ID=sa;"
strConn &= "Password=1234;"
oCmd = New SqlClient.SqlCommand
oCmd.Connection = New SqlClient.SqlConnection(strConn)
oCmd.Connection.Open()
oCmd.CommandText = txtSQL.Text
txtRows.Text = oCmd.ExecuteNonQuery().ToString()
oCmd.Connection.Close()
End Sub
End Class
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-07-27
展开全部
为什么要用VB写呢?javascript不行吗?ajax不行吗?验证控件不行吗?
既然VB不会写干嘛非要钻牛角尖呢
既然VB不会写干嘛非要钻牛角尖呢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询