📄 sysfunc.inc
字号:
<%
function newtemp()
newtemp=""
for i=1 to 4
Randomize
if i mod 2=1 then
newtemp=newtemp&chr(int(rnd*26)+97)
else
newtemp=newtemp&chr(int(rnd*10)+48)
end if
next
end function
function nextcodea(ss)
dim i,cc,sstot,yss
yss=ss
i=0
cc=right(ss,1)
sstot=len(ss)
do while cc="z"
i=i+1
ss=mid(ss,1,sstot - i)+"a"+mid(ss,sstot - i + 2)
if sstot - i> 0 then
cc=mid(ss,sstot - i,1)
else
cc=""
end if
loop
if sstot - i > 0 then
cc=mid(ss,sstot - i,1)
cc=chr(asc(cc) + 1)
ss=mid(ss,1,sstot - i - 1)+cc+mid(ss,sstot - i + 1)
nextcodea=ss
else
nextcodea=yss
end if
end function
function nextcoded(ss)
dim i,cc,sstot,yss
yss=ss
i=0
cc=right(ss,1)
sstot=len(ss)
do while cc="a"
i=i+1
ss=mid(ss,1,sstot - i)+"z"+mid(ss,sstot - i + 2)
if sstot - i> 0 then
cc=mid(ss,sstot - i,1)
else
cc=""
end if
loop
if sstot - i > 0 then
cc=mid(ss,sstot - i,1)
cc=chr(asc(cc) - 1)
ss=mid(ss,1,sstot - i - 1)+cc+mid(ss,sstot - i + 1)
nextcoded=ss
else
nextcoded=yss
end if
end function
function syskeyno(tablename,fieldname)
set rsa=server.CreateObject("ADODB.Recordset")
set rsb=server.CreateObject("ADODB.Recordset")
sqltext="select * from sys_keyno where tablename='"+tablename+"' and fieldname='"+fieldname+"' "
rsa.Open sqltext,cn,1,3
if not rsa.EOF then
rsa("currvalue")=rsa("currvalue")+1
syskeyno=rsa("currvalue")+1
else
sqltext="select "+fieldname+" from "+tablename+" order by "+fieldname+" desc"
rsb.Open sqltext,cn,1,1
if rsb.EOF then
currvalue=0
else
currvalue=rsb(0)
end if
rsb.Close
rsa.AddNew
rsa("tablename")=tablename
rsa("fieldname")=fieldname
rsa("currvalue")=currvalue+1
syskeyno=currvalue+1
end if
rsa.Update
rsa.Close
set rsa=nothing
set rsb=nothing
end function
function selectxh(fieldname,ordername,byasc,defaultasc)
if defaultasc<>"asc" then defaultasc="desc"
if fieldname=ordername then
if byasc="desc" then
selectxh="asc"
else
selectxh="desc"
end if
else
selectxh=defaultasc
end if
end function
function mydate(dd)
if dd="" then
mydate=""
else
mydate=year(dd)&"-"&month(dd)&"-"&day(dd)&" "&formatdatetime(dd,4)
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -