|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用cdonts,可以发送、查看邮件,实现webmail的功能。结合wsh,可以实现对nt主机的管理,如nt用户管理、iis虚拟主机设置、exchange邮箱设置等等,就像管理本地机一样方便。函数<%
判别文件名是不是正当
FunctionisFilename(aFilename)
DimsErrorStr,iNameLength,i
isFilename=TRUE
sErrorStr=Array("/","",":","*","?","""","<",">","|")
iNameLength=Len(aFilename)
IfiNameLength<1OriNameLength=nullThen
isFilename=FALSE
Else
Fori=0To8
Ifinstr(aFilename,sErrorStr(i))Then
isFilename=FALSE
EndIf
Next
EndIf
EndFunction
往失落字符串头尾的一连的回车和空格
functiontrimVBcrlf(str)
trimVBcrlf=rtrimVBcrlf(ltrimVBcrlf(str))
endfunction
往失落字符串开首的一连的回车和空格
functionltrimVBcrlf(str)
dimpos,isBlankChar
pos=1
isBlankChar=true
whileisBlankChar
ifmid(str,pos,1)=""then
pos=pos+1
elseifmid(str,pos,2)=VBcrlfthen
pos=pos+2
else
isBlankChar=false
endif
wend
ltrimVBcrlf=right(str,len(str)-pos+1)
endfunction
往失落字符串开端的一连的回车和空格
functionrtrimVBcrlf(str)
dimpos,isBlankChar
pos=len(str)
isBlankChar=true
whileisBlankCharandpos>=2
ifmid(str,pos,1)=""then
pos=pos-1
elseifmid(str,pos-1,2)=VBcrlfthen
pos=pos-2
else
isBlankChar=false
endif
wend
rtrimVBcrlf=rtrim(left(str,pos))
endfunction
判别Email是不是无效,前往1暗示准确
FunctionisEmail(aEmail)
DimiLocat,v,iLength,i,checkletter
Ifinstr(aEmail,"@")=0Orinstr(aEmail,".")=0Then
isEmail=0
EXITFUNCTION
EndIf
iLocat=instr(aEmail,"@")
Ifinstr(iLocat,aEmail,".")=0Orinstr(iLocat+1,aEmail,"@")>0Then
isEmail=0
EXITFUNCTION
EndIf
Ifleft(aEmail,1)="."Orright(aEmail,1)="."Orleft(aEmail,1)="@"Orright(aEmail,1)="@"Then
isEmail=0
EXITFUNCTION
EndIf
v="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-.@"
iLength=len(aEmail)
Fori=1ToiLength
checkletter=mid(aEmail,i,1)
Ifinstr(v,checkletter)=0Then
isEmail=0
EXITFUNCTION
EndIf
Next
isEmail=1
EndFunction
测试用:显现服务器信息
SubshowServer
Dimname
Response.write"<Tableborder=1bordercolor=lightblueCELLSPACING=0>"
foreachnameinrequest.servervariables
Response.write"<tr>"
Response.write"<td>"&name&"</td>"
Response.write"<td>"&request.servervariables(name)&"<br></td>"
Response.write"</tr>"
next
Response.write"</table>"
EndSub
测试用:显现Rs了局集和字段称号
SubshowRs(rs)
DimstrTable,whatever
Response.write"<center><table><tr>"
foreachwhateverinrs.fields
response.write"<td><b>"&whatever.name&"</B></TD>"
next
strTable="</tr><tr><td>"&rs.GetString(,,"</td><td>","</tr><tr><td>","")&"</td></tr></table></center>"
Response.Write(strTable)
EndSub
用HTML格局显现文本
functionHTMLEncode(fString)
ifnotisnull(fString)then
fString=replace(fString,">",">")
fString=replace(fString,"<","<")
fString=Replace(fString,CHR(32),"")
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>")
HTMLEncode=fString
endif
endfunction
测试用:显现调试毛病信息
SubshowError
DimsErrMsg
sErrMsg=Err.Source&""&Err.Description
Response.write"<center>"&sErrMsg&"</center>"
Err.clear
EndSub
显现笔墨计数器
SubshowCounter
Dimfs,outfile,filename,count
filename=server.mappath("count.txt")
Setfs=CreateObject("Scripting.FileSystemObject")
Iffs.fileExists(filename)Then
Setoutfile=fs.openTextFile(filename,1)
count=outfile.readline
count=count+1
Response.write"<center>扫瞄人次:"&count&"<center>"
outfile.close
Setoutfile=fs.CreateTextFile(filename)
outfile.writeline(count)
Else
Setoutfile=fs.openTextFile(filename,8,TRUE)
count=0
outfile.writeline(count)
ENDIF
outfile.close
setfs=nothing
EndSub
%>在实现ERP等高端的ASP应用时,用户需要提供核心的经营资料,需要ASP商有很高的信用度。楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。 |
|