📄 login.aspx.vb
字号:
Imports System.Data.SqlClient
Imports system.configuration
Imports System.Web.Configuration
Imports System.Data
Partial Class login
Inherits System.Web.UI.Page
Public pulic As New pulic1
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If IsValid Then
Dim cmd As New String("select count(*) from manager where username='" & TextBox1.Text & "' and passwd='" & TextBox2.Text & "'")
Dim count As Integer = Convert.ToInt32(pulic.Scalar(cmd)) 'count中即为总数目
If count <> 0 Then
Dim cmd1 As New String("select count(*) from using where usrname='" & TextBox1.Text & "' and stat='00'")
If Convert.ToInt32(pulic.Scalar(cmd1)) <> 0 Then
Response.Write("此帐户已经登陆" & "<br>")
Else
Dim strSQL As String = "INSERT INTO using(usrname,stat) values ('" & TextBox1.Text & "','00')"
pulic.noquery(strSQL) ' 屏蔽
'判断当前用户的权限, 并返回权限
Dim cmd2 As New String("select * from manager where username='" & TextBox1.Text & "' and passwd='" & TextBox2.Text & "'")
Dim myReader As SqlDataReader = pulic.execute(cmd2)
While myReader.Read()
Session("quyucode") = myReader("quyucode").trim
Session("deptcode") = myReader("deptcode").trim
Session("kecode") = myReader("kecode").trim
Session("taxcode") = myReader("taxcode").trim
Session("bz") = myReader("bz").trim
Session("quanxian") = myReader("quanxian").trim
Session("managerid") = myReader("id").trim
Session("using") = TextBox1.Text.Trim
End While
myReader.Close()
If (Session("bz") <> "admin") And (Session("bz") <> "sss") And (Session("bz") <> "fff") And (Session("bz") <> "kkk") Then
Session("s") = "nsrinf.quyucode='" & Session("quyucode") & "'" + " and nsrinf.deptcode='" & Session("deptcode") & "'" + " and nsrinf.kecode='" & Session("kecode") & "'" + " and nsrinf.taxcode='" & Session("taxcode") & "'"
Session("s1") = "quyucode='" & Session("quyucode") & "'" + " and deptcode='" & Session("deptcode") & "'" + " and kecode='" & Session("kecode") & "'" + " and taxcode='" & Session("taxcode") & "'"
Else
If Session("bz") = "admin" Then
Session("s") = ""
Session("s1") = ""
End If
If Session("bz") = "sss" Then
Session("s") = "nsrinf.quyucode='" & Session("quyucode") & "'"
Session("s1") = "quyucode='" & Session("quyucode") & "'"
End If
If Session("bz") = "fff" Then
Session("s") = "nsrinf.quyucode='" & Session("quyucode") & "'" + " and nsrinf.deptcode='" & Session("deptcode") & "'"
Session("s1") = "quyucode='" & Session("quyucode") & "'" + " and deptcode='" & Session("deptcode") & "'"
End If
If Session("bz") = "kkk" Then
Session("s") = "nsrinf.quyucode='" & Session("quyucode") & "'" + " and nsrinf.deptcode='" & Session("deptcode") & "'" + " and nsrinf.kecode='" & Session("kecode") & "'"
Session("s1") = "quyucode='" & Session("quyucode") & "'" + " and deptcode='" & Session("deptcode") & "'" + " and kecode='" & Session("kecode") & "'"
End If
End If
Dim riqi As String = Format(Now(), "yyyy-MM-dd dddd hh-mm-ss")
Dim strSQL1 As String = "INSERT INTO lg(name,start) values ('" & Trim(TextBox1.Text) & "','" & Trim(riqi) & "')"
pulic.noquery(strSQL1)
TextBox2.Text = ""
Response.Redirect("index.aspx")
End If
Else
TextBox2.Text = ""
Response.Redirect("cuowu.aspx")
End If
Me.Dispose()
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("bz") = "" Then
TextBox1.Focus()
Else
Response.Redirect("index.aspx")
End If
' MsgBox(Label4.Text, 0, "")
' Response.Write("if (confirm( '确定打印吗? ')==true){return true}else{return false} ")
' Response.Write(" <script language=javascript> if(confirm( '确定修改吗 ')){点击确定后执行的操作}else{点击取消后执行的操作} </script> ")
' Response.Write(" <script language=javascript> if(confirm('是否退出网络报税系统?')){ Response.Redirect('exit.aspx')}else{ Response.Redirect('exit.aspx')} </script> ")
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -