时间:2021-05-26
<%
ConstIsDeBug=1
ClassNewaspMain_Cls
Publicmembername,memberpass,membergrade,membergroup,memberid
Publicmemberclass,menbernickname,Cookies_Name,CheckPassword
PublicSiteName,SiteUrl,MasterMail,keywords,Copyright
PublicInstallDir,IndexName,IstopSite,StopReadme,IsCloseMail
PublicSendMailType,MailFrom,MailServer,MailUserName,MailPassword,MailInformPass,ChkSameMail
PublicCheckUserReg,AdminCheckReg,AddUserPoint,SendRegMessage,FullContQuery,ActionTime
PublicIsRunTime,UploadClass,UploadFileSize,UploadFileType,ContentKeyword,PreviewSetting
PublicStopApplyLink,FSO_ScriptName,InitTitleColor,StopBankPay
PublicChinaeBank,VersionID,Badwords,Badwordr,serialcode,passedcode
PublicChannelName,ChannelDir,StopChannel,ChannelType
Publicmodules,ChannelSkin,HtmlPath,HtmlForm,HtmlPrefix
PublicIsCreateHtml,HtmlExtName,StopUpload,MaxFileSize,UpFileType
PublicIsAuditing,AppearGrade,ModuleName,BindDomain,DomainName
PublicPostGrade,LeastString,MaxString,PaginalNum,LeastHotHist,Channel_Setting
PublicChannelSetting,ChannelData,ChannelPath
PublicChannelModule,ChannelHtmlPath,ChannelHtmlForm,ChannelUseHtml,ChannelHtmlExt,ChannelPrefix
PublicThisEdition,CopyrightStr,Version,Values,startime
PublicSqlQueryNum,GetUserip,CacheName,Reloadtime
PublicScriptName,Admin_Page,skinid,SkinPath,HtmlCss,HtmlTop,HtmlFoot,HtmlContent,sHtmlContent
PrivateMain_Style,Main_Setting,MainStyle,Html_Setting
PrivateLocalCacheName,Cache_Data
PrivateCacheChannel,CacheData
PrivatearrGroupSetting,blnGroupSetting,binUserLong
PrivateSubClass_Initialize()
OnErrorResumeNext
Reloadtime=28800
SqlQueryNum=0
'--缓存名称
CacheName="newasp"
Cookies_Name="newasp_net"
binUserLong=False
blnGroupSetting=False
GetUserip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
IfLen(GetUserip)=0ThenGetUserip=Request.ServerVariables("REMOTE_ADDR")
GetUserip=CheckStr(GetUserip)
membername=CheckStr(Request.Cookies(Cookies_Name)("username"))
memberpass=CheckStr(Request.Cookies(Cookies_Name)("password"))
menbernickname=CheckStr(Request.Cookies(Cookies_Name)("nickname"))
membergrade=ChkNumeric(Request.Cookies(Cookies_Name)("UserGrade"))
membergroup=CheckStr(Request.Cookies(Cookies_Name)("UserGroup"))
memberclass=ChkNumeric(Request.Cookies(Cookies_Name)("UserClass"))
memberid=ChkNumeric(Request.Cookies(Cookies_Name)("userid"))
CheckPassword=CheckStr(Request.Cookies(Cookies_Name)("CheckPassword"))
Dimtmpstr,i
tmpstr=Request.ServerVariables("PATH_INFO")
tmpstr=Split(tmpstr,"/")
i=UBound(tmpstr)
ScriptName=LCase(tmpstr(i))
Admin_Page=False
IfInStr(ScriptName,"showerr")>0OrInStr(ScriptName,"login")>0OrInStr(ScriptName,"admin_")>0ThenAdmin_Page=True
EndSub
PrivateSubClass_Terminate()
IfIsObject(Conn)ThenConn.Close:SetConn=Nothing
EndSub
'===================服务器缓存部分函数开始===================
PublicPropertyLetName(ByValvNewValue)
LocalCacheName=LCase(vNewValue)
Cache_Data=Application(CacheName&"_"&LocalCacheName)
EndProperty
PublicPropertyLetValue(ByValvNewValue)
IfLocalCacheName<>""Then
ReDimCache_Data(2)
Cache_Data(0)=vNewValue
Cache_Data(1)=Now()
Application.Lock
Application(CacheName&"_"&LocalCacheName)=Cache_Data
Application.UnLock
Else
Err.RaisevbObjectError+1,"NewaspCacheServer","pleasechangetheCacheName."
EndIf
EndProperty
PublicPropertyGetValue()
IfLocalCacheName<>""Then
IfIsArray(Cache_Data)Then
Value=Cache_Data(0)
Else
'Err.RaisevbObjectError+1,"NewaspCacheServer","TheCache_Data("&LocalCacheName&")IsEmpty."
EndIf
Else
Err.RaisevbObjectError+1,"NewaspCacheServer","pleasechangetheCacheName."
EndIf
EndProperty
PublicFunctionObjIsEmpty()
ObjIsEmpty=True
IfNotIsArray(Cache_Data)ThenExitFunction
IfNotIsDate(Cache_Data(1))ThenExitFunction
IfDateDiff("s",CDate(Cache_Data(1)),Now())<(60*Reloadtime)ThenObjIsEmpty=False
EndFunction
PublicSubDelCahe(MyCaheName)
Application.Lock
Application.Contents.Remove(CacheName&"_"&MyCaheName)
Application.UnLock
EndSub
PublicSubDelCache(MyCaheName)
Application.Lock
Application.Contents.Remove("mynewasp_"&MyCaheName)
Application.UnLock
EndSub
'===================服务器缓存部分函数结束===================
PublicFunctionChkBoolean(ByValValues)
IfTypeName(Values)="Boolean"OrIsNumeric(Values)OrLCase(Values)="false"OrLCase(Values)="true"Then
ChkBoolean=CBool(Values)
Else
ChkBoolean=False
EndIf
EndFunction
PublicFunctionCheckNumeric(ByValCHECK_ID)
IfCHECK_ID<>""AndIsNumeric(CHECK_ID)Then
CHECK_ID=CCur(CHECK_ID)
Else
CHECK_ID=0
EndIf
CheckNumeric=CHECK_ID
EndFunction
PublicFunctionChkNumeric(ByValCHECK_ID)
IfCHECK_ID<>""AndIsNumeric(CHECK_ID)Then
CHECK_ID=CLng(CHECK_ID)
IfCHECK_ID<0ThenCHECK_ID=0
Else
CHECK_ID=0
EndIf
ChkNumeric=CHECK_ID
EndFunction
PublicFunctionCheckStr(ByValstr)
IfIsNull(str)Then
CheckStr=""
ExitFunction
EndIf
str=Replace(str,Chr(0),"")
CheckStr=Replace(str,"'","''")
EndFunction
'================================================
'过程名:CheckNull
'作用:是否有效值
'================================================
PublicFunctionCheckNull(ByValsValue)
OnErrorResumeNext
IfIsNull(sValue)Then
CheckNull=False
ExitFunction
EndIf
IfTrim(sValue)<>""AndLCase(Trim(sValue))<>"http://"Then
CheckNull=True
Else
CheckNull=False
EndIf
EndFunction
PublicFunctionChkNull(ByValstr)
OnErrorResumeNext
IfIsNull(str)Then
ChkNull=""
ExitFunction
EndIf
IfTrim(str)<>""AndLCase(Trim(str))<>"http://"Then
ChkNull=Trim(str)
Else
ChkNull=""
EndIf
EndFunction
'=============================================================
'函数名:ChkFormStr
'作用:过滤表单字符
'参数:str----原字符串
'返回值:过滤后的字符串
'=============================================================
PublicFunctionChkFormStr(ByValstr)
DimfString
fString=str
IfIsNull(fString)Then
ChkFormStr=""
ExitFunction
EndIf
fString=Replace(fString,"'","'")
fString=Replace(fString,Chr(34),""")
fString=Replace(fString,Chr(13),"")
fString=Replace(fString,Chr(10),"")
fString=Replace(fString,Chr(9),"")
fString=Replace(fString,">",">")
fString=Replace(fString,"<","<")
fString=Replace(fString,"%","%")
ChkFormStr=Trim(JAPEncode(fString))
EndFunction
'=============================================================
'函数作用:过滤SQL非法字符
'=============================================================
PublicFunctionCheckRequest(ByValstr,ByValstrLen)
OnErrorResumeNext
str=Trim(str)
str=Replace(str,Chr(0),"")
str=Replace(str,"'","")
str=Replace(str,"%","")
str=Replace(str,"^","")
str=Replace(str,";","")
str=Replace(str,"*","")
str=Replace(str,"<","")
str=Replace(str,">","")
str=Replace(str,"|","")
str=Replace(str,"and","")
str=Replace(str,"chr","")
IfLen(str)>0AndstrLen>0Then
str=Left(str,strLen)
EndIf
CheckRequest=str
EndFunction
'--移除有害字符
PublicFunctionRemoveBadCharacters(ByValstrTemp)
Dimre
OnErrorResumeNext
Setre=NewRegExp
re.Pattern="[^\s\w]"
re.Global=True
RemoveBadCharacters=re.Replace(strTemp,"")
Setre=Nothing
EndFunction
'--去掉HTML标记
PublicFunctionRemoveHtml(ByValTextstr)
DimStr,re
Str=Textstr
OnErrorResumeNext
Setre=NewRegExp
re.IgnoreCase=True
re.Global=True
re.Pattern="<(.[^>]*)>"
Str=re.Replace(Str,"")
Setre=Nothing
RemoveHtml=Str
EndFunction
'--数据库连接
PublicFunctionExecute(Command)
IfNotIsObject(Conn)ThenConnectionDatabase
IfIsDeBug=0Then
OnErrorResumeNext
SetExecute=Conn.Execute(Command)
IfErrThen
err.Clear
SetConn=Nothing
Response.Write"查询数据的时候发现错误,请检查您的查询代码是否正确。<br/><li>"
Response.WriteCommand
Response.End
EndIf
Else
SetExecute=Conn.Execute(Command)
EndIf
SqlQueryNum=SqlQueryNum+1
EndFunction
PublicSubReadConfig()
OnErrorResumeNext
Name="Config"
IfObjIsEmpty()ThenReloadConfig
CacheData=Value
'第一次起用系统或者重启IIS的时候加载缓存
Name="Date"
IfObjIsEmpty()Then
Value=Date
Else
IfCStr(Value)<>CStr(Date)Then
Name="Config"
CallReloadConfig
CacheData=Value
EndIf
EndIf
SiteName=CacheData(1,0):SiteUrl=CacheData(2,0):MasterMail=CacheData(3,0):keywords=CacheData(4,0):Copyright=CacheData(5,0):InstallDir=CacheData(6,0)
IndexName=CacheData(7,0):IstopSite=CacheData(8,0):StopReadme=CacheData(9,0):IsCloseMail=CacheData(10,0):SendMailType=CacheData(11,0):MailFrom=CacheData(12,0)
MailServer=CacheData(13,0):MailUserName=CacheData(14,0):MailPassword=CacheData(15,0):CheckUserReg=CacheData(16,0):AdminCheckReg=CacheData(17,0):MailInformPass=CacheData(18,0)
ChkSameMail=CacheData(19,0):AddUserPoint=CacheData(20,0):SendRegMessage=CacheData(21,0):FullContQuery=CacheData(22,0):ActionTime=CacheData(23,0):IsRunTime=CacheData(24,0)
UploadClass=CacheData(25,0):UploadFileSize=CacheData(26,0):UploadFileType=CacheData(27,0):ContentKeyword=CacheData(28,0):StopApplyLink=CacheData(29,0):FSO_ScriptName=CacheData(30,0)
InitTitleColor=CacheData(31,0):StopBankPay=CacheData(32,0):ChinaeBank=CacheData(33,0):VersionID=CacheData(34,0):Badwords=CacheData(35,0):Badwordr=CacheData(36,0)
serialcode=CacheData(37,0):passedcode=CacheData(38,0):PreviewSetting=CacheData(39,0)
ThisEdition="免费版(FreeEdition)"
Version="Poweredby:<ahref=""http:///shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'type='application/x-shockwave-flash'width=$2height=$3>$4</embed>")
re.Pattern="\[UPLOAD=(gif|jpg|jpeg|bmp|png)\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/UPLOAD\]"
strContent=re.Replace(strContent,"<br><AHREF=""$2$1""TARGET=_blank><IMGSRC=""$2$1""border=0alt=按此在新窗口浏览图片onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""></A>")
re.Pattern="(\[UPLOAD=(.[^\[]*)\])(.[^\[]*)(\[\/UPLOAD\])"
strContent=re.Replace(strContent,"<br><ahref=""$3"">点击浏览该文件</a>")
re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
strContent=re.Replace(strContent,"<AHREF=""$2""TARGET=_blank>$2</A>")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent=re.Replace(strContent,"<AHREF=""$2""TARGET=_blank>$3</A>")
re.Pattern="(\[EMAIL\])(.[^\[]*)(\[\/EMAIL\])"
strContent=re.Replace(strContent,"<AHREF=""mailto:$2"">$2</A>")
re.Pattern="(\[EMAIL=(.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
strContent=re.Replace(strContent,"<AHREF=""mailto:$2""TARGET=_blank>$3</A>")
re.Pattern="(\[HTML\])(.[^\[]*)(\[\/HTML\])"
strContent=re.Replace(strContent,"<tablewidth='100%'border='0'cellspacing='0'cellpadding='6'bgcolor='#F6F6F6'><td><b>以下内容为程序代码:</b><br>$2</td></table>")
re.Pattern="(\[code\])(.[^\[]*)(\[\/code\])"
strContent=re.Replace(strContent,"<tablewidth='100%'border='0'cellspacing='0'cellpadding='6'bgcolor='#F6F6F6'><td><b>以下内容为程序代码:</b><br>$2</td></table>")
re.Pattern="(\[color=(.[^\[]*)\])(.[^\[]*)(\[\/color\])"
strContent=re.Replace(strContent,"<fontcolor=$2>$3</font>")
re.Pattern="(\[face=(.[^\[]*)\])(.[^\[]*)(\[\/face\])"
strContent=re.Replace(strContent,"<fontface=$2>$3</font>")
re.Pattern="\[align=(center|left|right)\](.*)\[\/align\]"
strContent=re.Replace(strContent,"<divalign=$1>$2</div>")
re.Pattern="(\[QUOTE\])(.*)(\[\/QUOTE\])"
strContent=re.Replace(strContent,"<tablecellpadding=0cellspacing=0border=1WIDTH=94%bordercolor=#000000bgcolor=#F2F8FFalign=center><tr><td><tablewidth=100%cellpadding=5cellspacing=1border=0><TR><TDBGCOLOR='#F6F6F6'>$2</table></table><br>")
re.Pattern="(\[move\])(.*)(\[\/move\])"
strContent=re.Replace(strContent,"<MARQUEEscrollamount=3>$2</marquee>")
re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
strContent=re.Replace(strContent,"<tablewidth=$1style=""filter:glow(color=$2,strength=$3)"">$4</table>")
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
strContent=re.Replace(strContent,"<tablewidth=$1style=""filter:shadow(color=$2,strength=$3)"">$4</table>")
Setre=Nothing
strContent=Replace(strContent,"[InstallDir_ChannelDir]",InstallDir&"/"&ChannelDir)
strContent=Replace(strContent,"{","{")
strContent=Replace(strContent,"}","}")
strContent=Replace(strContent,"$","$")
ReadContent=strContent
EndFunction
EndClass
%>
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
右击有main方法的类===>Runas===>RunConfigurations===>双击javaapplication===>单击有main方法的类===
将Program类的删除,将里面的静态类Main修改后放入服务类中:复制代码代码如下:partialclassServer1:ServiceBase{publi
Java使用agent实现main方法之前的实例详解创建Agent项目PreMainExecutor类,在main方法之前执行此方法publicclassPre
0ThensTempContent=Newasp.CutMatchContent(strTemp,"{$ReadArticleList(",")}",1)nTe
本文实例讲述了java基于线程池和反射机制实现定时任务的方法。分享给大家供大家参考,具体如下:主要包括如下实现类:1.Main类:任务执行的入口:调用main方