弹出无边框网页的Javscrpt代码
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.OleDb
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
''关闭连接
2![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Sub CloseConn()Sub CloseConn()
3
Conn.Dispose()
4
End Sub
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function OpenConn()Function OpenConn()
2
''连接数据库字符串
3
Dim connStr As String
4
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
5
& HttpContext.Current.Request.ServerVariables("APPL_PHYSICAL_PATH") _
6
& "App_Data\DataBase.mdb"
7
''定义数据库连接
8
conn = New OleDbConnection(connStr)
9
conn.Open() ''打开
10
Return False
11
End Function
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
''此函数获取管理用户登录信息
2![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function MySet()Function MySet()
3
If IsNothing(HttpContext.Current.Request.Cookies("MyInfor")) Then
4
''未登录的情况
5
HttpContext.Current.Response.Redirect("Default.aspx")
6
Else
7
''已登录后的情况
8
Dim myCookie As HttpCookie = HttpContext.Current.Request.Cookies("MyInfor")
9
StrAdminName = myCookie("UserName")
10
StrPassword = myCookie("Password")
11
StrLoginTime = myCookie("LoginTime")
12
End If
13
Return False
14
End Function
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function IsAdminLogined()Function IsAdminLogined() As Boolean
2
If IsNothing(HttpContext.Current.Request.Cookies("MyInfor")) Then
3
''未登录的情况
4
IsAdminLogined = False
5
Else
6
'已登录后的情况
7
IsAdminLogined = True
8
End If
9
Return IsAdminLogined
10
End Function
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function md5()Function md5(ByVal Str As String) As String
2
md5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Str, "MD5")
3
Return md5
4
End Function
![](/Images/OutliningIndicators/ContractedBlock.gif)
VB.NET操作JS代码
1
''设置警告对话框
2![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function SetAlert()Function SetAlert(ByVal Str As String) As String
3
HttpContext.Current.Response.Write("<script language=""JavaScript"" type=""text/JavaScript"">alert('" & Str & "');</script>")
4
Return False
5
End Function
6![](/Images/OutliningIndicators/None.gif)
7
''设置关闭窗口
8![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function SetCloseWindow()Function SetCloseWindow() As String
9
HttpContext.Current.Response.Write("<script language=""JavaScript"" type=""text/JavaScript"">window.close();</script>")
10
Return False
11
End Function
12![](/Images/OutliningIndicators/None.gif)
13
'地址跳转
14![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function SetLocation()Function SetLocation(ByVal Str As String)
15
HttpContext.Current.Response.Write("<script language=""JavaScript"">" & Chr(13) & " location=""" & Str & """<" & "/" & "script>")
16
Return False
17
End Function
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function MySqlDataSource()Function MySqlDataSource(ByVal Sql As String) As DataView
2
Try
3
OpenConn()
4
Dim Da As OleDbDataAdapter
5
Dim Ds As New DataSet
6
''sql 为传过来的查询语句
7
Da = New OleDbDataAdapter(Sql, conn)
8
Da.Fill(Ds, "temp")
9
CloseConn()
10
MySqlDataSource = Ds.Tables("temp").DefaultView
11
Return MySqlDataSource
12
Catch ex As Exception
13![](/Images/OutliningIndicators/InBlock.gif)
14
End Try
15
End Function
16![](/Images/OutliningIndicators/None.gif)
17![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Function MySqlExcute()Function MySqlExcute(ByVal Sql As String)
18
OpenConn()
19
Dim cmd As OleDbCommand
20
''sql 为传过来的查询语句
21
cmd = New OleDbCommand(Sql, conn)
22
cmd.ExecuteNonQuery()
23
CloseConn()
24
Return False
25
End Function
26
Imports System.Data
Imports System.Data.OleDb
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
1![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
ublic Class ConfigClass Config
2
Public conn As OleDbConnection
3![](/Images/OutliningIndicators/InBlock.gif)
4
Public StrAdminName As String ''管理用户名
5
Public StrPassword As String ''密码
6
Public StrLoginTime As String ''登录时间
7![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
2
![](/Images/OutliningIndicators/InBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
2
![](/Images/OutliningIndicators/InBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/InBlock.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/InBlock.gif)
14
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
2
![](/Images/OutliningIndicators/InBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
2
![](/Images/OutliningIndicators/InBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
8
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
12
![](/Images/OutliningIndicators/None.gif)
13
![](/Images/OutliningIndicators/None.gif)
14
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
15
![](/Images/OutliningIndicators/InBlock.gif)
16
![](/Images/OutliningIndicators/InBlock.gif)
17
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
2
![](/Images/OutliningIndicators/InBlock.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/InBlock.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/InBlock.gif)
14
![](/Images/OutliningIndicators/InBlock.gif)
15
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
16
![](/Images/OutliningIndicators/None.gif)
17
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
18
![](/Images/OutliningIndicators/InBlock.gif)
19
![](/Images/OutliningIndicators/InBlock.gif)
20
![](/Images/OutliningIndicators/InBlock.gif)
21
![](/Images/OutliningIndicators/InBlock.gif)
22
![](/Images/OutliningIndicators/InBlock.gif)
23
![](/Images/OutliningIndicators/InBlock.gif)
24
![](/Images/OutliningIndicators/InBlock.gif)
25
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
26
![](/Images/OutliningIndicators/None.gif)