您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->汽车配件公司网站(VB.net+Access数据库)源码>>admin.aspx.vb>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:汽车配件公司网站(VB.net+Access数据库)源码
当前文件:文件类型 VbNetCompany/admin.aspx.vb打开代码结构图
普通视图
		            
1Imports System 2Imports System.Data 3Imports System.Configuration 4Imports System.Collections 5Imports System.Web 6Imports System.Web.Security 7Imports System.Web.UI 8Imports System.Web.UI.WebControls 9Imports System.Web.UI.WebControls.WebParts 10Imports System.Web.UI.HtmlControls 11Imports System.Data.OleDb 12 13Public Partial Class admin 14 Inherits System.Web.UI.Page 15 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) 16 17 End Sub 18 19 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) 20 Try 21 Using oleconn As New OleDbConnection() 22 oleconn.ConnectionString = ConfigurationManager.ConnectionStrings("oleConnectionString").ConnectionString 23 oleconn.Open() 24 Dim strSQL As String = "Select * From admin where admin_name='" + admin_name.Text.ToString() + "' " 25 Dim command As New OleDbCommand(strSQL, oleconn) 26 Dim dataReader As OleDbDataReader = command.ExecuteReader() 27 If dataReader.Read() Then 28 Dim mypassword As String = dataReader("admin_pwd").ToString() 29 If mypassword = admin_pwd.Text.ToString() Then 30 Session("admin") = dataReader("admin_name").ToString() 31 Session("loginpwd") = dataReader("admin_pwd").ToString() 32 Session("loginname") = dataReader("admin_name").ToString() 33 Response.Redirect("admin_main.aspx") 34 Else 35 Response.Write("<script language='javascript'>window.confirm('密码不正确,请后退重填!!');</script>") 36 Response.Write("<script language='javascript'>parent.window.history.go(-1);</script>") 37 38 End If 39 Else 40 Response.Write("<script language='javascript'>window.confirm('用户名不正确!!');</script>") 41 Response.Write("<script language='javascript'>parent.window.history.go(-1);</script>") 42 End If 43 dataReader.Close() 44 oleconn.Close() 45 oleconn.Dispose() 46 End Using 47 Catch err As Exception 48 Dim str As String = err.Message.Replace("'", "") 49 Response.Write("<script>alert('" + str + "');</script>") 50 End Try 51 End Sub 52End Class
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:汽车配件公司网站(VB.net+Access数据库)源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号