www.gusucode.com > 拓网网络硬盘系统源码程序 > 拓网网络硬盘系统 3.0/Admin/Inc/Cls_Admin.asp
<% '============================================================================== '软件名称:拓网文件上传提取系统 '当前版本:拓网文件上传提取系统1.0(TopWang Upload V1.0) 'Copyright (C) 2003-2006 TopWang.Com All rights reserved. '产品咨询QQ:742631333 '程序开发:拓网产品开发组 'Email:Service@TopWang.Com '官方网站:www.TopWang.com '论坛支持:拓网在线论坛(http://bbs.TopWang.com) '免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接 '============================================================================== '============================================================================== '文件名:Cls_Admin.asp '摘 要:后台管理类 '作 者:拓网产品开发组 '更 新:2006-2-10 '============================================================================== Class Cls_Admin Private Sub Class_Initialize() End Sub Private Sub Class_Terminate() End Sub Public Function CheckManager(CheckType,PowerId) Dim AdminName,PowerList AdminName=Trim(Session(CahceName&"_Admin")) PowerList=Trim(Session(CacheName&"_Power")) Select Case CheckType Case 0 If AdminName="" or PowerList="" Then SysMsg="您还没有登陆,请登陆!" Call ClsPub.Alert("Admin_Login.asp",1) Else If InStr(PowerList&",",PowerId&",")<=0 Then SysMsg="对不起,您无权访问该页!" Call ClsPub.Alert("Back",0) End If End If Case 1 If AdminName="" Then CheckManager="" Else CheckManager=AdminName End If Case 2 If AdminName="" Then SysMsg="您还没有登陆,请先登陆." Call ClsPub.Alert("Admin_Login.asp",1) End If End Select End Function Public Function IsExistsFile(ByVal sFilePath) Dim objFSO Set objFSO = CreateObject(ServerObject_005) IsExistsFile=objFSO.FileExists (sFilePath) Set objFSO=Nothing End Function Public Sub DelFile(Filename) If Filename <> "" Then Set FSO = Server.CreateObject(ServerObject_005) If FSO.FileExists(Filename) Then FSO.DeleteFile Filename End If Set FSO = Nothing End If End Sub '#######过滤目录 Function FilterPath(strPath) strPath=Replace(Trim(strPath),"../","") strPath=Replace(Trim(strPath),"..\","") strPath=Replace(strPath,"\..","") strPath=Replace(strPath,"/..","") FilterPath=strPath End Function '#######获得父目录 Function GetParent(strPath) If strPath<>"" Then Dim I For I=Len(strPath) To 1 Step -1 If Mid(strPath,I,1)="/" Then GetParent=Left(strPath,I-1) Exit Function End If Next End If End Function '########取得文件扩展名 '返回值如:".exe"、".gif" Function GetEx(fileName) GetEx="."&mid(fileName,InStrRev(fileName, ".")+1) End Function '########取得文件扩展名所对应的图标 Function FileIco(f_name) Dim ex,ico ex=LCase(GetEx(f_name)) Select Case ex Case ".doc" ico="f_Doc.gif" Case ".txt" ico="f_txt.gif" Case ".mp3" ico="f_mp3.gif" Case ".gif" ico="f_pic.gif" Case ".bmp" ico="f_pic.gif" Case ".jpg" ico="f_pic.gif" Case ".ico" ico="f_pic.gif" Case ".rar" ico="f_rar.gif" Case ".zip" ico="f_rar.gif" Case ".htm" ico="f_htm.gif" Case ".html" ico="f_htm.gif" Case ".shtml" ico="f_htm.gif" Case ".asp" ico="f_asp.gif" Case ".xml" ico="f_asp.gif" Case ".jsp" ico="f_asp.gif" Case ".php" ico="f_asp.gif" Case ".css" ico="f_asp.gif" Case ".js" ico="f_asp.gif" Case ".asf" ico="f_media.gif" Case ".wmv" ico="f_media.gif" Case ".mdb" ico="f_mdb.gif" Case ".exe" ico="f_exe.gif" Case ".com" ico="f_exe.gif" Case ".bat" ico="f_exe.gif" Case ".swf" ico="f_swf.gif" Case ".fla" ico="f_swf.gif" Case ".rm" ico="f_rm.gif" Case ".dll" ico="f_dll.gif" Case ".sys" ico="f_dll.gif" Case ".ocx" ico="f_ocx.gif" Case ".ini" ico="f_ini.gif" Case ".dbx" ico="f_dbx.gif" Case ".cat" ico="f_cat.gif" Case ".pdf" ico="f_pdf.gif" Case ".hlp" ico="f_hlp.gif" Case ".htt" ico="f_htt.gif" Case ".png" ico="f_png.gif" Case ".chm" ico="f_chm.gif" Case ".nfo" ico="f_nfo.gif" Case ".reg" ico="f_reg.gif" Case ".key" ico="f_reg.gif" Case ".cpp" ico="f_cpp.gif" Case ".h" ico="f_h.gif" Case ".frm" ico="f_frm.gif" Case ".bas" ico="f_bas.gif" Case ".ctl" ico="f_ctl.gif" Case ".vbg" ico="f_vbg.gif" Case ".vbp" ico="f_vbp.gif" Case else: ico="UnKnow.gif" End Select FileIco=ico End Function End Class %>