📄 reg.aspx
字号:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDB" %>
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
End Sub
Sub ServerValidation(Source As Object,arguments As ServerValidateEventArgs)
Dim phone As string =trim(Arguments.Value)
Arguments.IsValid=(len(phone)=11)
End Sub
Sub Ok_click(Sender As Object,E As EventArgs)
'建立connection对象
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.9;Data Source=" & Server.MapPath("/database/duanxin.mdb"))
'建立Command对象
'Dim cmd As NewOleDbCommand("Insert into user(name,phone,type) values('"+name.text+"','"+phone.text+"','zp')",conn)
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户在这里注册手机</title>
<style type="text/css">
<!--
.style3 {font-size: 12px}
-->
</style>
</head>
<body>
<form runat="server">
<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#00CCFF" bordercolordark="#33CCFF">
<tr>
<td height="25" colspan="2" align="center" bgcolor="#FFFF00"><strong>手 机 注 册</strong></td>
</tr>
<tr>
<td height="40" align="center">
手机号码:
</td>
<td><asp:TextBox ID="phone" runat="server" Text='13' /><asp:CustomValidator OnServerValidate="ServerValidation" ControlToValidate="phone" ErrorMessage="这不是一个有效的手机号码!" ID="phone_validate" runat="server" /> </td>
</tr>
<tr>
<td height="40" align="center">用户名称:</td>
<td><asp:TextBox ID="name" runat="server" /><asp:RequiredFieldValidator ControlToValidate="name" Display="Static" ErrorMessage=" * 用户名需要输入" ID="name_validate" runat="server" /></td>
</tr>
<tr>
<td height="50" colspan="2"><span class="style3">说明:此页面可以做为注册页面的一部分(因为你说不用单独的手机注册页面,用户注册时填写这部分信息就可以了),而且可以做为旧数据库中手机向短信系统添加的页面。</span></td>
</tr>
<tr align="center">
<td colspan="2"><asp:Button ID="ok" Text="确定提交" OnClick="ok_click" runat="server" /></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -