?? conn.asp
字號(hào):
<%connbl=0
vdir=""
if instr(request.ServerVariables("URL"),"login.asp")<1 then
if instr(request.ServerVariables("URL"),"/admin/")>0 then
if session("LoginID")="" then
%>
<script>
parent.location.href="/admin/login.asp";
</script>
<%
response.End()
end if
end if
end if
set conn=server.CreateObject("adodb.connection")
if connbl=1 then
ConnStr="server=.;driver={sql server};database=TTNet;uid=sa;pwd="
else
connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("ttdb/ttwl.asp")
'connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data; Source="& Server.MapPath("../ttdb/ttwl.asp")
end if
conn.open connstr
if err.number>0 then
response.Write("數(shù)據(jù)庫(kù)錯(cuò)誤,請(qǐng)聯(lián)系管理員")
response.End()
end if
Function InterceptString(txt,length)
txt=trim(txt)
x = len(txt)
y = 0
if x >= 1 then
for ii = 1 to x
if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then
y = y + 2
else
y = y + 1
end if
if y >= length-2 then
txt = left(trim(txt),ii)&"…" '"字符串限長(zhǎng)
exit for
end if
next
InterceptString = txt
else
InterceptString = ""
end if
End Function
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -