Public Class _Default
Inherits System.Web.UI.Page
Dim conn As SqlConnection
Dim cmd As SqlCommand
Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim con As String = "server=TAK\SQLEXPRESS; uid=sa; pwd=1234; database=web; "
conn = New SqlConnection(con)
conn.Open()
End Sub
Public Sub btnsave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsave.Click
Dim reg As New Regex("[a-zA-Z0-9]{6,12}")
Dim chk As String = txusername.Text
If reg.IsMatch(chk) Then
Response.Write("ok")