验证码的问题
小弟初学,请问为什么验证会错误?Default.asp.vb
Partial Class _Default
Inherits System.Web.UI.Page
Function RndNum(ByVal VcodeNum)
Dim Vchar As String = "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,W,X,Y,Z"
Dim VcArray() As String = Split(Vchar, ",")
Dim VNum As String = ""
Dim i As Byte
For i = 1 To VcodeNum
Randomize()
VNum = VNum & VcArray(Int(35 * Rnd()))
Next
Return VNum
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim VNUM As String
Response.Cookies("VNUM").Value = RndNum(4)
VNUM = Request.Cookies("VNUM").Value
Label1.Text = VNUM
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = Label1.Text.ToLower Then
Label3.Text = "用户您好,欢迎登陆我是范范饭"
Else
Label3.Text = "验证码错误啦!!!"
End If
End Sub
End Class
Default.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www. >
<head id="Head1" runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
验证码:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Width="176px"></asp:Label>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
<br />
<asp:Label ID="Label3" runat="server" ForeColor="Lime" Height="96px" Width="384px"></asp:Label>
</div>
</form>
</body>
</html>