?? inc_function.asp
字號(hào):
<%
'┌─ 風(fēng)云ASP在線 ────────────────────────┐
'│ │
'│ 作者:趙振波. http://www.fyasp.com │
'│ │
'│ Q Q:176189168 │
'│ │
'│ Email:fy96@163.com │
'│ │
'│ 程序定做,系統(tǒng)開發(fā),網(wǎng)站制作,提供高質(zhì)量的網(wǎng)絡(luò)產(chǎn)品、技術(shù)和服務(wù)!│
'│ │
'│【版權(quán)聲明】 │
'│ │
'│ 本程序版權(quán)歸坐看風(fēng)云所有,未經(jīng)授權(quán)擅自修改、復(fù)制或散布本程序│
'│ │
'│的部分或全部,將承受嚴(yán)厲的民事和刑事處罰,對(duì)已知的違反者將給予法 │
'│ │
'│律范圍內(nèi)的全面制裁。對(duì)非法使用此程序所造成的一切后果本人概不負(fù)責(zé)!│
'│ │
'└─────────────────── http://www.fyasp.com ──┘
%>
<%
'/格式化時(shí)間/
Function FormatTime(TestTime,style)
Dim n,y,r,s,f,m
n = Year(TestTime)
y = Month(TestTime)
r = Day(TestTime)
s = Hour(TestTime)
f = Minute(TestTime)
m = Second(TestTime)
if len(n) = 2 then n = "20" & n
if len(y) = 1 then y = "0" & y
if len(r) = 1 then r = "0" & r
if len(s) = 1 then s = "0" & s
if len(f) = 1 then f = "0" & f
if len(m) = 1 then m = "0" & m
If style = 1 Then
FormatTime = "<font color=""#FF0000"">"& n &"</font>年<font color=""#FF0000"">"& y &"</font>月<font color=""#FF0000"">"& r &"</font>日<font color=""#FF0000"">"& s &"</font>時(shí)"
Elseif style = 2 Then
FormatTime = r &"日 "& s & ":" & f & ":" & m
Elseif style = 3 Then
FormatTime = n &"年"& y &"月"& r &"日"
Elseif style = 4 Then
FormatTime = n & "/" & y & "/" & r
Elseif style = 5 then
FormatTime = n &"-"& y &"-"& r &" " & s & ":" & f
Elseif style = 6 then
FormatTime = n &"年"& y &"月"& r &"日" & s &":"& f
Elseif style = 7 then
FormatTime = n & y & r & s & f & m
Elseif style = 8 then
FormatTime = n &"-"& y &"-"& r
End if
End Function
'/在一個(gè)表中判斷用戶輸入的一個(gè)字段的值是否已存在/
Function SearchFieldValue(vTableName,vFieldName,vFieldValue)
dim strField,sqlField
set strField = Server.CreateObject("ADODB.Recordset")
sqlField = "Select * From "& vTableName &" Where "& vFieldName &" = '"& vFieldValue &"'"
strField.Open sqlField,Conn
if not strField.EOF then
SearchFieldValue = True
else
SearchFieldValue = False
end if
strField.Close
set strField = nothing
end Function
'信息類型函數(shù) stype顯示類型1為表單,其它顯示文字鏈接 ,xxlx為類型參數(shù)
Function gqlx(stype,xxlx)
gqlx="出錯(cuò)啦!"
if stype=1 then
gqlx="<option value=""1"""
if xxlx="1" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"銷售信息</option>"
gqlx=gqlx&"<option value=""2"""
if xxlx="2" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"求購信息</option>"
gqlx=gqlx&"<option value=""3"""
if xxlx="3" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"要聞信息</option>"
gqlx=gqlx&"<option value=""4"""
if xxlx="4" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"動(dòng)態(tài)信息</option>"
gqlx=gqlx&"<option value=""5"""
if xxlx="5" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"招聘信息</option>"
gqlx=gqlx&"<option value=""6"""
if xxlx="6" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"求職信息</option>"
gqlx=gqlx&"<option value=""7"""
if xxlx="7" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"展會(huì)信息</option>"
gqlx=gqlx&"<option value=""8"""
if xxlx="8" then gqlx = gqlx&" selected"
gqlx = gqlx&">"
gqlx = gqlx&"其它信息</option>"
else
Select Case xxlx
Case "1"
gqlx = "<a href="&strSysUrl&"list.asp?lx=1><font color=#009933><span style=""text-decoration: none"">[銷售]</span></font></a>"
Case "2"
gqlx = "<a href="&strSysUrl&"list.asp?lx=2><font color=#ff0000><span style=""text-decoration: none"">[求購]</span></font></a>"
Case "3"
gqlx = "<a href="&strSysUrl&"list.asp?lx=3><font color=#FF00FF><span style=""text-decoration: none"">[要聞]</span></font></a>"
Case "4"
gqlx = "<a href="&strSysUrl&"list.asp?lx=4><font color=#008080><span style=""text-decoration: none"">[動(dòng)態(tài)]</span></font></a>"
Case "5"
gqlx = "<a href="&strSysUrl&"list.asp?lx=5><font color=#0000FF><span style=""text-decoration: none"">[招聘]</span></font></a>"
Case "6"
gqlx = "<a href="&strSysUrl&"list.asp?lx=6><font color=#9900FF><span style=""text-decoration: none"">[求職]</span></font></a>"
Case "7"
gqlx = "<a href="&strSysUrl&"list.asp?lx=7><font color=#CC6600><span style=""text-decoration: none"">[展會(huì)]</span></font></a>"
Case "8"
gqlx = "<a href="&strSysUrl&"list.asp?lx=8><font color=#000000><span style=""text-decoration: none"">[其它]</span></font></a>"
End Select
end if
Response.Write gqlx
end Function
'/字符過濾/
function changechr(str)
changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>")," ","")
changechr=replace(replace(replace(replace(changechr,"'",""),"and",""),"insert",""),"set","")
changechr=replace(replace(replace(replace(changechr,"select",""),"update",""),"delete%20from",""),chr(34),""")
end function
'/在一個(gè)表中判斷用戶輸入的一個(gè)字段是否與其它字段重名,除了他本身以外/
Function SearchEditFieldValue(vTableName,vFieldname,vFieldValue,vIDName,intIDValue)
dim strField1,sqlField1
set strField1 = Server.CreateObject("ADODB.Recordset")
sqlField1 = "Select * From "& vTableName &" Where "& vFieldName &" = '"& vFieldValue &"'"
strField1.Open sqlField1,Conn
if not strField1.EOF then
do while not strField1.EOF
if int(intIDValue) <> strField1(vIDName) then
SearchEditFieldValue = True
exit Function
end if
strField1.MoveNext
loop
SearchEditFieldValue = False
end if
strField1.Close
set strField1 = nothing
End Function
'/判斷會(huì)員是否超時(shí)/
Function IsTimeOut(vMember,vPassWord)
Dim rdsMember1
Dim sqlMember1
set rdsMember1 = Server.CreateObject("ADODB.Recordset")
sqlMember1 = "Select * From Dat_Member Where Member = '"& vMember &"' And PassWord = '"& vPassWord &"'"
rdsMember1.Open sqlMember1,Conn
If Not rdsMember1.EOF Then
IsTimeOut = False
Else
IsTimeOut = True
End if
rdsMember1.Close
set rdsMember1 = nothing
End Function
'/獲得會(huì)員的編號(hào)/
Function getMemberKey(Member)
Dim rdsMember
Dim sqlMember
set rdsMember = Server.CreateObject("ADODB.Recordset")
sqlMember = "Select * From Dat_Member Where Member = '"& Member &"'"
rdsMember.Open sqlMember,Conn,1,1
if not rdsMember.EOF then
getMemberKey = rdsMember("MemberKey")
else
getMemberKey = 0
end if
rdsMember.Close
set rdsMember = nothing
End Function
function dvHTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
dvHTMLEncode = fString
end if
end function
Function LeftT(str,n)
If len(str)<=n/2 Then
LeftT=str
Else
Dim TStr
Dim l,t,c
Dim i
l=len(str)
t=l
TStr=""
t=0
for i=1 to l
c=asc(mid(str,i,1))
If c<0 then c=c+65536
If c>255 then
t=t+2
Else
t=t+1
End If
If t>n Then exit for
TStr=TStr&(mid(str,i,1))
next
LeftT = TStr+".."
End If
End Function
'/非HTML代碼轉(zhuǎn)換函數(shù)/
Function Html2Txt(vString)
vString = replace(vString, ">", ">")
vString = replace(vString, "<", "<")
vString = Replace(vString, CHR(32) & CHR(32) & CHR(32) & CHR(32), " ")
vString = Replace(vString, CHR(10) & CHR(10), "<br>")
vString = Replace(vString, CHR(10), "<BR>")
Html2Txt = vString
End Function
function HTMLEncode(fString)
fString = Replace(fString, CHR(32) & CHR(32) & CHR(32) & CHR(32), " ")
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
HTMLEncode = fString
end function
function GetIp()
'如果客戶端用了代理服務(wù)器,則應(yīng)該用ServerVariables("HTTP_X_FORWARDED_FOR")方法
getclientip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If getclientip = "" Then
'如果客戶端沒用代理,應(yīng)該用Request.ServerVariables("REMOTE_ADDR")方法
getclientip = Request.ServerVariables("REMOTE_ADDR")
end if
GetIp = getclientip
end function
Function bbHTMLDecode(reString) '轉(zhuǎn)換HTML代碼
Dim Str:Str=reString
If Not IsNull(Str) Then
Str = Replace(Str, "&", "&")
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
Str = Replace(Str, " ", CHR(32))
Str = Replace(Str, " ", CHR(9))
Str = Replace(Str, "    ", CHR(9))
Str = Replace(Str, """, CHR(34))
Str = Replace(Str, "'", CHR(39))
Str = Replace(Str, "", CHR(13))
Str = Replace(Str, "<br>", CHR(10))
Str = Replace(Str, "<BR>", CHR(10))
bbHTMLDecode = Str
End If
End Function
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
Function RtnReplaceInt(iCheck,iDefault)
If Trim(iCheck)="" Then
RtnReplaceInt = iDefault
Exit Function
End If
If IsNumeric(iCheck)=false Then
RtnReplaceInt = iDefault
Exit Function
End If
RtnReplaceInt = iCheck
End Function
'/出錯(cuò)提示函數(shù)/
Sub ShowMessage()
if strMsgTitle = "" then strMsgTitle = "異常出錯(cuò)"
if strMsg = "" then strMsg = "未知錯(cuò)誤"
%>
<br>
<table border="0" width="70%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="100%" bgcolor="#3986CE">
<table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%" align="center" bgcolor="#3986CE" height="30"><% = strMsgTitle%></td>
</tr>
<tr>
<td width="100%" align="center" height="68" bgcolor="#FFFFFF" style="line-height:200%"><% = strMsg%></td>
</tr>
<tr>
<td width="100%" align="center" height="25" class="banma2"><input onclick="parent.location.href='Javascript:history.back()'" type="button" value="返 回" class="face" name="button1"></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<%End Sub%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -