AspEase Auction System Ver2.0/动易拍卖系统 Ver2.0

源代码在线查看: function.asp

软件大小: 318 K
上传用户: granite518
关键词: 2.0 Ver AspEase Auction
下载地址: 免注册下载 普通下载 VIP

相关代码

								Function ChkPost()
						Dim server_v1,server_v2
						Chkpost=False 
						server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
						server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
						If Mid(server_v1,8,len(server_v2))=server_v2 Then Chkpost=True 
					End Function
				function Printout(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), " ")
				    fString = Replace(fString, CHR(10), " ")
				    fString=ChkBadWords(fString,"goods")
				    Printout = fString
				end if
				end function
				function checkStr(str)
					if isnull(str) then
						checkStr = ""
						exit function 
					end if
					checkStr=replace(str,"'","''")
				end function
				function fstr(str)
					if isnull(str) then
						fstr= ""
						exit function
					end if
					fstr=replace(replace(str,"'","")," ","")
				end function
				Function EvalBool(pvValue)
				   Dim sTemp
				   Select Case VarType(pvValue)
				      Case 0, 1:
				         EvalBool = False
				      Case 2, 3, 4, 5, 6:
				         If pvValue Then
				            EvalBool = True
				         Else
				            EvalBool = False
				         End If
				      Case 8: 'String
				         sTemp = UCase(Left(Trim(pvValue), 1))
				         Select Case sTemp
				            Case "Y", "T", "A", "W", "V", "Z",  "1", "-":
				               EvalBool = True
				            Case "N", "F", "0", "":
				               EvalBool = False
				            Case Else
				               EvalBool = False
				         End Select
				      Case 11:
				         If pvValue Then
				            EvalBool = True
				         Else
				            EvalBool = False
				         End If
				      Case Else
				         EvalBool = False
				   End Select
				End Function
				Function SQLBool(pvValue)
				   Dim sTemp
				   Select Case VarType(pvValue)
				      Case 0, 1:
				         SQLBool = "'N'"
				      Case 2, 3, 4, 5, 6:
				         If pvValue Then
				            SQLBool = "'Y'"
				         Else
				            SQLBool = "'N'"
				         End If
				      Case 8: 'String
				         sTemp = UCase(Left(Trim(pvValue), 1))
				         Select Case sTemp
				            Case "Y", "T", "1", "-":
				               SQLBool = "'Y'"
				            Case "N", "F", "0", "":
				               SQLBool = "'N'"
				            Case Else
				               SQLBool = "'N'"
				         End Select
				      Case 11:
				         If pvValue Then
				            SQLBool = "'Y'"
				         Else
				            SQLBool = "'N'"
				         End If
				      Case Else
				         SQLBool = "'N'"
				   End Select
				End Function
				function isInteger(para)
				       on error resume next
				       dim str
				       dim l,i
				       if isNUll(para) then 
				          isInteger=false
				          exit function
				       end if
				       str=cstr(para)
				       if trim(str)="" then
				          isInteger=false
				          exit function
				       end if
				       l=len(str)
				       for i=1 to l
				           if mid(str,i,1)>"9" or mid(str,i,1)				              isInteger=false 
				              exit function
				           end if
				       next
				       isInteger=true
				       if err.number0 then err.clear
				end function
				Function FVal(pvValue)
				   Dim sTemp
				
				   Select Case VarType(pvValue)
				      Case 0, 1:
				         FVal = 0
				      Case 2, 3, 4, 5, 6:
				         FVal = pvValue
				      Case 8: 'String
				         sTemp = Trim(pvValue)
				         On Error Resume Next
				         FVal = CDbl(sTemp)
				         If Err.Number  0 Then
				            Err.Clear
				            FVal = 0
				         End If
				      Case Else
				         FVal = 0
				   End Select
				End Function
				Function SQLVal(pvValue)
				   Dim sTemp
				
				   Select Case VarType(pvValue)
				      Case 0, 1:
				         SQLVal = "NULL"
				      Case 2, 3, 4, 5, 6:
				         SQLVal = "" & pvValue
				      Case 8: 'String
				         sTemp = Trim(pvValue)
				         On Error Resume Next
				         SQLVal = "" & CDbl(sTemp)
				         If Err.Number  0 Then
				            Err.Clear
				            SQLVal = "NULL"
				         End If
				      Case 11:
				         SQLVal = "" & Cint(pvValue)         
				      Case Else
				         SQLVal = "NULL"
				   End Select
				End Function
				Function SQLTVal(pvValue)
				   Dim sTemp
				
				   Select Case VarType(pvValue)
				      Case 0, 1:
				         SQLTVal = "0"
				      Case 2, 3, 4, 5, 6:
				         SQLTVal = "" & pvValue
				      Case 8: 'String
				         sTemp = Trim(pvValue)
				         On Error Resume Next
				         SQLTVal = "" & CDbl(sTemp)
				         If Err.Number  0 Then
				            Err.Clear
				            SQLTVal = "0"
				         End If
				      Case 11:
				         SQLTVal = "" & Cint(pvValue)         
				      Case Else
				         SQLTVal = "0"
				   End Select
				End Function
				Function Rst( psValueName )
				   Dim sTemp 
				   sTemp = Request.Form("" & psValueName)
				   If Len(Trim(sTemp)) = 0 Then
				      sTemp = Request.QueryString("" & psValueName)
				   End If
				   Rst = sTemp
				End Function
				
				Function SQLStr(pvValue)
				   Dim sTemp
				   Select Case VarType(pvValue)
				      Case 0, 1:
				         SQLStr = "NULL"
				      Case 2, 3, 4, 5, 6:
				         sTemp = "" & pvValue
				         sTemp = Replace(sTemp, "'", "''")
				         SQLStr = "'" & sTemp & "'"
				      Case 7: 'DateTime
				         sTemp = FormatDateTime(pvValue)
				         sTemp = Replace(sTemp, "'", "''")
				         SQLStr = "'" & sTemp & "'"
				      Case 8: 'String
				         sTemp = pvValue
				         sTemp = Replace(sTemp, "'", "''")
				         If Len(Trim(sTemp)) > 0 Then
				            SQLStr = "'" & sTemp & "'"
				         Else
				            SQLStr = "NULL"
				         End If
				      Case Else
				         SQLStr = "NULL"
				   End Select
				End Function
				Function SQLTStr(pvValue)
				   Dim sTemp
				   Select Case VarType(pvValue)
				      Case 0, 1:
				         SQLTStr = "NULL"
				      Case 2, 3, 4, 5, 6:
				         sTemp = "" & pvValue
				         sTemp = Replace(sTemp, "'", "''")
				         SQLTStr =  sTemp 
				      Case 7: 'DateTime
				         sTemp = FormatDateTime(pvValue)
				         sTemp = Replace(sTemp, "'", "''")
				         SQLTStr =  sTemp 
				      Case 8: 'String
				         sTemp = pvValue
				         sTemp = Replace(sTemp, "'", "''")
				         If Len(Trim(sTemp)) > 0 Then
				            SQLTStr =  sTemp 
				         Else
				            SQLTStr = "NULL"
				         End If
				      Case Else
				         SQLTStr = "NULL"
				   End Select
				End Function
				Function NumToStrLeadDigits(pvValue, piDigits)
				   Dim sTemp
				   sTemp = Trim("" & pvValue)
				   Do While Len(sTemp) < piDigits
				      sTemp = "0" & sTemp
				   Loop
				   NumToStrLeadDigits = sTemp
				End Function
				
				function ChkBadWords(fString,stype)   
					if stype="goods" then
							if not(isnull(webgoodsBadWords) or isnull(fString)) then
							bwords = split(webgoodsBadWords, "|")
							for ii = 0 to ubound(bwords)
								fString = Replace(fString, bwords(ii), string(len(bwords(ii)),"*")) 
							next			
							end if				
					else
							if not(isnull(webuserBadWords) or isnull(fString)) then
							bwords = split(webuserBadWords, "|")
							for ii = 0 to ubound(bwords)				
								fString = Replace(fString, bwords(ii), string(len(bwords(ii)),"*")) 
							next			
							end if			
					end if
					ChkBadWords = fString
				end function
				
				function strLength(str)
				       ON ERROR RESUME NEXT
				       dim WINNT_CHINESE
				       WINNT_CHINESE    = (len("动易")=2)
				       if WINNT_CHINESE then
				          dim l,t,c
				          dim i
				          l=len(str)
				          t=l
				          for i=1 to l
				             c=asc(mid(str,i,1))
				             if c				             if c>255 then
				                t=t+1
				             end if
				          next
				          strLength=t
				       else 
				          strLength=len(str)
				       end if
				       if err.number0 then err.clear
				end function
				
				Function SQLDate(pvDate)
				    Dim sSQLDate
				    Dim vDate
				    Dim iBuild
				    Dim sYear, sMonth, sDay, sHour, sMinute, sSecond
				    sSQLDate = "NULL"
				    iBuild = False
				    Select Case VarType(pvDate)
				        Case 7: 'Date
				        	iBuild = True
				        	vDate = pvDate
				        Case 8: 'String
				            If IsDate(pvDate) Then
				                vDate = CDate(pvDate)
				                iBuild = True
				            End If
				    End Select
				    
				    If iBuild Then
				       if AspEaseAuctionDateFormat=0 then
				                sYear = "" & Year(vDate)
				                Do While Len(sYear) < 4
				                	sYear = "0" & sYear
				                Loop
				                sMonth = "" & Month(vDate)
				                Do While Len(sMonth) < 2
				                	sMonth = "0" & sMonth
				                Loop
				                sDay = "" & Day(vDate)
				                Do While Len(sDay) < 2
				                	sDay = "0" & sDay
				                Loop
				                sHour = "" & Hour(vDate)
				                Do While Len(sHour) < 2
				                	sHour = "0" & sHour
				                Loop
				                sMinute = "" & Minute(vDate)
				                Do While Len(sMinute) < 2
				                	sMinute = "0" & sMinute
				                Loop
				                sSecond = "" & Second(vDate)
				                Do While Len(sSecond) < 2
				                	sSecond = "0" & sSecond
				                Loop
				                If (Hour(vDate)=0) And (Minute(vDate)=0) And (Second(vDate)=0) Then
				                	sSQLDate = "" & sYear & "-" & sMonth & "-" & sDay & ""
				                Else
				                	sSQLDate = "" & sYear & "-" & sMonth & "-" & sDay & " " & sHour & ":" & sMinute & ":" & sSecond & ""
				                End If
						else
							sSQLDate=now()
				        end if
				    End If    
				    sSQLDate = Replace(sSQLDate, ".", "/")
				    SQLDate = sSQLDate
				End Function
				Function ErrStr(sField)
					ErrStr = replace(easereguserErr,"$$fieldname$$",UCASE(sField)) & ""
				End Function
				Function OutMatch(pvFirst, pvSecond, pvMatchOut, pvBadOut)
				   Dim sFirst
				   Dim sSecond
				   sFirst = Trim("" & pvFirst)
				   sSecond = Trim("" & pvSecond)
				   If sFirst = sSecond Then
				      OutMatch = pvMatchOut
				   Else
				      OutMatch = pvBadOut
				   End If
				End Function
				%>			

相关资源