⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pub_config.asp

📁 企业办公全自动化系统
💻 ASP
字号:

<link rel="stylesheet" href="lib/pub_MainStyle.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
'---------- 初始化 ----------
session.timeout = 120
'打开缓冲
'Response.buffer = true

'打开数据库
Connpath		= server.mappath("lib\Weather.mdb")
Set Conn		= Server.CreateOBject("Adodb.connection")
Conn.Open "Data Source="+Connpath+";Provider=Microsoft.Jet.OLEDB.4.0;"

if Err.number <> 0 then                                  '数据库连接失败
	Response.Write "数据库连接失败,请联系系统管理员!"
	Response.End
end if

'取得网页文件代码函数
function getHTTPPage(url)
dim http
set http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then 
	exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear 
end function

'取得省份代码函数
Function GetShenname(data)
	if data <> "" then
		set GetRs = conn.execute("Select Name from part1 where id="&data)
			GetShenname = GetRs("Name")
		Set GetRs = nothing
	end if
end Function

'取得城市名称函数
Function GetShiName(data)
	if data <> "" then
		Set GetRs = conn.execute("Select name from part2 where value='"&data&"'")
			GetShiName = GetRs("Name")
		Set GetRs = nothing
	end if
end Function

'字节转化成字符串函数
Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function

'错误提示函数
function ShowError()
	Response.write "无法找到该网页文件或页面抓取过程中发生错误!"
	Response.end
end Function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -