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

📄 pubcode.asp

📁 一个很好的在线购物系统
💻 ASP
字号:

<%
'主要功能:控制键盘输出(按照不同的输出类型),若键盘输入不符合输出类型则不响应键盘事件
'参数:CONTROLVALUE:要控制的输入控件的值
'	   STYPE:输出类型("NUM"代表数值型,"INT"代表整形,"CHAR"代表字符型)
'	  IKEYASCII:键盘响应值(window.event.keyCode)
'返回:处理后的键盘响应值
%>
<SCRIPT LANGUAGE=VBScript>
 Function PublicKeyAscii(ControlValue , sTYpe , iKeyAscii ) 
    Dim sTemp 
    Dim iDoc 
    If iKeyAscii = 8 Then
        PublicKeyAscii = iKeyAscii
        Exit Function
    End If
    
  Select Case UCase(sTYpe)
     Case "NUM"
                sTemp = Trim(ControlValue)
                If iKeyAscii = 46 Then
                    iDoc = InStr(1, sTemp, ".")
				    If iDoc = 0 Then
                       PublicKeyAscii = iKeyAscii
                    Else
                       PublicKeyAscii = 0
                    End If
                    Exit Function
                End If
                
                If (iKeyAscii <= 57 And iKeyAscii >=48) or iKeyAscii=45 Then
                        PublicKeyAscii = iKeyAscii
                Else
                        PublicKeyAscii = 0
                End If
     Case "INT"
            If (iKeyAscii <= 57 And iKeyAscii >=48) or iKeyAscii=45 Then
                PublicKeyAscii = iKeyAscii
            Else
                PublicKeyAscii = 0
            End If
     Case "CHAR"
           PublicKeyAscii = iKeyAscii
 End Select
End Function
</script>

⌨️ 快捷键说明

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