<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<!-- #include file=inc/adminset.asp-->
<% '=========================================================
' File: admin_folder.asp
' Version:3.0
' Date: 2005-9-17
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
	If UserGroupID=1 and Master Then
		Master = True
	Else
		Master = False
	End If
	If Not Master Then
	Response.write "您不是系统管理员！"
	response.end
	end if
	If Master And Session("flag")<>"" Then
	call filerename()
	response.write("<script>alert('更名成功！');window.close();</script>") 
	response.end
	else
	Response.Redirect "index.asp"
	response.end
	end if

	sub filerename()
		dim oldadminpaths,fs,Ts,Newadminpath,Oldloginnames,Newloginname
		Set fs = CreateObject("Scripting.FileSystemObject")
		oldadminpaths = Server.Mappath(OldAdminpath)
		Set Ts= fs.GetFolder(oldadminpaths)
		Newadminpath=replace(Adminpath,"/","")
		if Adminpath<>oldadminpath then
			Ts.name=Newadminpath
		end if
		Oldloginnames = Server.Mappath(Oldloginname)
		Set Ts= fs.GetFile(Oldloginnames)
		Newloginname=LoginUrl
		if Newloginname<>Oldloginname then
			Ts.name=Newloginname
		end if
			call constsave()
		set Ts=nothing
		set fs=nothing
	end sub
	
	sub constsave()
		dim hf
		set hf=fs.CreateTextFile(Server.mappath("inc/adminset.asp"),true)
		hf.write "<" & "%" & vbcrlf
		hf.write "Const OldAdminpath=" & chr(34) & Newadminpath&"/" & chr(34) & "" & vbcrlf
		hf.write "Const Oldloginname=" & chr(34) & Newloginname & chr(34) & "" & vbcrlf
		hf.write "%" & ">"
	end sub
%>