asp静态生成,伪静态

Asp 专栏收录该内容
22 篇文章 0 订阅

 

<% '上传大图片 elseif num=4 then %> <%if edit<>"" then%> <%=zhi%> <%else%> <%=zhi%> <%end if%> <% '上传小图片 elseif num=8 then %> <%if edit<>"" then%> <%=zhi%> <%else%> <%=zhi%> <%end if%> <% elseif num=3 then %>

<%=zhi%>
<%if edit<>"" then%> <%else%> <%end if%> <% else end if end function %> <% '下面是最具技术含量的函数了,哈哈~ '增加数据库字段 function addziduan(ziduanming,ziduanleixing) on error resume next fldname = ziduanming if ziduanleixing=1 or ziduanleixing=4 then fldtype = "VarChar" fldsize = 255 elseif ziduanleixing=2 or ziduanleixing=3 then fldtype = "Text" fldsize = "" end if fldnull = "ON" fldautoincrement = "" table_name = tables if fldname <> "" and fldtype <> "" then sql = "alter table [" & table_name & "] add ["&fldname&"] " & fldtype if fldsize <> "" then sql = sql & "(" & fldsize & ")" end if if fldnull <> "ON" then sql = sql & " not null" end if conn.execute(sql) if err <> 0 then response.Write " " end if end if end function %> <% Const adEmpty = 0 Const adTinyInt = 16 Const adSmallInt = 2 Const adInteger = 3 Const adBigInt = 20 Const adUnsignedTinyInt = 17 Const adUnsignedSmallInt = 18 Const adUnsignedInt = 19 Const adUnsignedBigInt = 21 Const adSingle = 4 Const adDouble = 5 Const adCurrency = 6 Const adDecimal = 14 Const adNumeric = 131 Const adBoolean = 11 Const adError = 10 Const adUserDefined = 132 Const adVariant = 12 Const adIDispatch = 9 Const adIUnknown = 13 Const adGUID = 72 Const adDate = 7 Const adDBDate = 133 Const adDBTime = 134 Const adDBTimeStamp = 135 Const adBSTR = 8 Const adChar = 129 Const adVarChar = 200 Const adLongVarChar = 201 Const adWChar = 130 Const adVarWChar = 202 Const adLongVarWChar = 203 Const adBinary = 128 Const adVarBinary = 204 Const adLongVarBinary = 205 '---- FieldAttributeEnum Values ---- Const adFldMayDefer = &H00000002 Const adFldUpdatable = &H00000004 Const adFldUnknownUpdatable = &H00000008 Const adFldFixed = &H00000010 Const adFldIsNullable = &H00000020 Const adFldMayBeNull = &H00000040 Const adFldLong = &H00000080 Const adFldRowID = &H00000100 Const adFldRowVersion = &H00000200 Const adFldCacheDeferred = &H00001000 '---- SchemaEnum Values ---- '---- SchemaEnum Values ---- Const adSchemaProviderSpecific = -1 Const adSchemaAsserts = 0 Const adSchemaCatalogs = 1 Const adSchemaCharacterSets = 2 Const adSchemaCollations = 3 Const adSchemaColumns = 4 Const adSchemaCheckConstraints = 5 Const adSchemaConstraintColumnUsage = 6 Const adSchemaConstraintTableUsage = 7 Const adSchemaKeyColumnUsage = 8 Const adSchemaReferentialConstraints = 9 Const adSchemaTableConstraints = 10 Const adSchemaColumnsDomainUsage = 11 Const adSchemaIndexes = 12 Const adSchemaColumnPrivileges = 13 Const adSchemaTablePrivileges = 14 Const adSchemaUsagePrivileges = 15 Const adSchemaProcedures = 16 Const adSchemaSchemata = 17 Const adSchemaSQLLanguages = 18 Const adSchemaStatistics = 19 Const adSchemaTables = 20 Const adSchemaTranslations = 21 Const adSchemaProviderTypes = 22 Const adSchemaViews = 23 Const adSchemaViewColumnUsage = 24 Const adSchemaViewTableUsage = 25 Const adSchemaProcedureParameters = 26 Const adSchemaForeignKeys = 27 Const adSchemaPrimaryKeys = 28 Const adSchemaProcedureColumns = 29 Const adSchemaDBInfoKeywords = 30 Const adSchemaDBInfoLiterals = 31 Const adSchemaCubes = 32 Const adSchemaDimensions = 33 Const adSchemaHierarchies = 34 Const adSchemaLevels = 35 Const adSchemaMeasures = 36 Const adSchemaProperties = 37 Const adSchemaMembers = 38 Const adSchemaTrustees = 39 Const adSchemaFunctions = 40 Const adSchemaActions = 41 Const adSchemaCommands = 42 Const adSchemaSets = 43 '==================================================================返回字段类型函数 Function typ(field_type) 'field_type = 字段类型值 Select Case field_type case adEmpty:typ = "Empty" case adTinyInt:typ = "TinyInt" case adSmallInt:typ = "SmallInt" case adInteger:typ = "Integer" case adBigInt:typ = "BigInt" case adUnsignedTinyInt:typ = "TinyInt" 'UnsignedTinyInt case adUnsignedSmallInt:typ = "UnsignedSmallInt" case adUnsignedInt:typ = "UnsignedInt" case adUnsignedBigInt:typ = "UnsignedBigInt" case adSingle:typ = "Single" 'Single case adDouble:typ = "Double" 'Double case adCurrency:typ = "Money" 'Currency case adDecimal:typ = "Decimal" case adNumeric:typ = "Numeric" 'Numeric case adBoolean:typ = "Bit" 'Boolean case adError:typ = "Error" case adUserDefined:typ = "UserDefined" case adVariant:typ = "Variant" case adIDispatch:typ = "IDispatch" case adIUnknown:typ = "IUnknown" case adGUID:typ = "GUID" 'GUID case adDATE:typ = "DateTime" 'Date case adDBDate:typ = "DBDate" case adDBTime:typ = "DBTime" case adDBTimeStamp:typ = "DateTime" 'DBTimeStamp case adBSTR:typ = "BSTR" case adChar:typ = "Char" case adVarChar:typ = "VarChar" case adLongVarChar:typ = "LongVarChar" case adWChar:typ = "Text" 'WChar类型 SQL中为Text case adVarWChar:typ = "VarChar" 'VarWChar case adLongVarWChar:typ = "Text" 'LongVarWChar case adBinary:typ = "Binary" case adVarBinary:typ = "VarBinary" case adLongVarBinary:typ = "LongBinary"'LongVarBinary case adChapter:typ = "Chapter" case adPropVariant:typ = "PropVariant" case else:typ = "Unknown" end select End Function %> <% Function biao() set Rsb=server.createobject("adodb.recordset") rsb.open "select * from "&tables&"",conn,1,1 response.Write" " rsb.close set rsb = Nothing End Function %> <% public dingid Function dingjiid(nu) if shangjis(nu)<>0 then call dingjiid(shangjis(nu)) else dingid=nu end if dingjiid=dingid End Function %> <% public configtype Function configtypes(nu) if configg(nu)=0 then call configtypes(shangjis(nu)) else configtype=nu end if configtypes=configtype End Function %> <% Function configg(nu) set Rsb=server.createobject("adodb.recordset") rsb.open "select * from "&config&" where lid="ν&"",conn,1,1 configg=rsb.recordcount rsb.close set rsb = Nothing End Function %> <% Function jueduizhi() jueduizhi = now() jueduizhi = trim(jueduizhi) jueduizhi = replace(jueduizhi,"-","") jueduizhi = replace(jueduizhi,"/","") jueduizhi = replace(jueduizhi," ","") jueduizhi = replace(jueduizhi,":","") jueduizhi = replace(jueduizhi,"PM","") jueduizhi = replace(jueduizhi,"AM","") jueduizhi = replace(jueduizhi,"上午","") jueduizhi = replace(jueduizhi,"下午","") End Function %> <% Function CheckStringLength(txt) txt=trim(txt) x = len(txt) y = 0 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 next CheckStringLength = y End Function '--************* 截取字符串 ************** 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 then txt = left(trim(txt),ii) '字符串限长 exit for end if next InterceptString = txt else InterceptString = "" end if End Function function noHTML(str) dim re Set re=new RegExp re.IgnoreCase =true re.Global=True re.Pattern="(/<.[^/<]*/>)" str=re.replace(str," ") re.Pattern="(/<//[^/<]*/>)" str=re.replace(str," ") str=replace(str,chr(10),"") str=replace(str,chr(13),"") str=replace(str,chr(32),"") str=replace(str," ","") noHTML=str set re=nothing end function public sub GetCode() response.write " " end sub public sub CodeIsTrue(b) if CStr(Session("GetCode"))<>cstr(Trim(Request("VerifyCode"))) then randomize Session("GetCode")=rnd() if b="" then response.write " <script> </script> " else response.write " <script> </script> " end if Response.End end if end sub %>

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值