|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了,=======================
检测上页是不是从本站提交
前往:True,False
=======================
FunctionIsSelfRefer()
DimsHttp_Referer,sServer_Name
sHttp_Referer=CStr(Request.ServerVariables("HTTP_REFERER"))
sServer_Name=CStr(Request.ServerVariables("SERVER_NAME"))
IfMid(sHttp_Referer,8,Len(sServer_Name))=sServer_NameThen
IsSelfRefer=True
Else
IsSelfRefer=False
EndIf
EndFunction
*****************************
创立文件目次
*****************************
DimFs,NewPath,DelPath,FPath,DelFPath
FunctionFsFolder(TName)
NewPath=Server.MapPath(""&Tname&"")
SetFs=Server.CreateObject("Scripting.FileSystemObject")
IfFs.FolderExists(NewPath)=TrueThen
Response.Write"<scriptlanguage=JavaScript>"&_
"alert(有此文件夹名请从头定名);"&_
"history.go(-1);"&_
"</script>"
Response.End
Else
Fs.CreateFolder(NewPath)
SetFs=Nothing
EndIf
EndFunction
*****************************
删除文件目次
*****************************
FunctionDelFolder(TName)
DelPath=Server.MapPath(""&TName&"")
SetFs=Server.CreateObject("Scripting.FileSystemObject")
IfFs.FolderExists(DelPath)=TrueThen
Fs.DeleteFolderDelPath,True
EndIf
SetFs=Nothing
EndFunction
***************************************
创立文件
***************************************
FunctionCreateFile(FName,strFile)
DimFPath,Os,Fs
FPath=Server.MapPath(""&FName&"")
SetFs=Server.CreateObject("Scripting.FileSystemObject")
SetOs=Fs.CreateTextFile(FPath,True,False)
Os.WritestrFile
Os.Close
SetOs=Nothing
SetFs=Nothing
EndFunction
***************************************
删除文件
***************************************
FunctionDelFile(Fname)
SetFs=Server.CreateObject("Scripting.FileSystemObject")
Fname=Server.MapPath(Fname)
Response.WriteFname
IfFs.FileExists(Fname)=FalseThen
ExitFunction
Else
Fs.DeleteFileFname,True
EndIf
SetFs=Nothing
EndFunction
*****************************
读取文件
*****************************
FunctionReadFile(Fname)
DimStrFile,Fs,Os
SetFs=Server.CreateObject("Scripting.FileSystemObject")
Fname=Server.MapPath(Fname)
IfFs.FileExists(Fname)=FalseThen
ReadFile=""
ExitFunction
Else
SetOs=Fs.OpenTextFile(Fname,1,False,False)
StrFile=Os.ReadAll
Os.Close
SetOs=Nothing
Response.WriteStrFile
ReadFile=StrFile
EndIf
SetFs=Nothing
EndFunction
***------分页入手下手------
FunctionURLStr(FieldName,FieldValue)
Dimi
IfNotIsArray(FieldName)ThenExitFunction
Fori=0toUbound(FieldName)
URLStr=URLStr&"&"&Cstr(FieldName(i))&"="&Cstr(FieldValue(i))
Next
EndFunction
FunctionPageList(iPageValue,iRetCount,iCurrentPage,FieldName,FieldValue)
DimUrl
DimPageCount页总数
DimPageRoot页列表头
DimPageFoot页列表尾
DimOutStr
Url=URLStr(FieldName,FieldValue)
If(iRetCountModiPageValue)=0Then
PageCount=iRetCountiPageValue
Else
PageCount=(iRetCountiPageValue)+1
EndIf
IfiCurrentPage-4<=1Then
PageRoot=1
Else
PageRoot=iCurrentPage-4
EndIf
IfiCurrentPage+4>=PageCountThen
PageFoot=PageCount
Else
PageFoot=iCurrentPage+4
EndIf
OutStr="分页:"&iCurrentPage&"/"&PageCount&"页共"&iRetCount&"条"
IfPageRoot=1Then
IfiCurrentPage=1Then
OutStr=OutStr&"9"
OutStr=OutStr&"7"
Else
OutStr=OutStr&"<ahref=?page=1"
OutStr=OutStr&Url
OutStr=OutStr&"title=""首页"">9"
OutStr=OutStr&"<ahref=?page="&iCurrentPage-1
OutStr=OutStr&Url
OutStr=OutStr&"title=""上页"">7"
EndIf
Else
OutStr=OutStr&"<ahref=?page=1"
OutStr=OutStr&Url</p>缺乏可以共同遵循的行业标准,ASP还处在发展初期,大家对它的理解不同,如产品和服务标准,收费标准等,不利于行业的健康发展。 |
|