<%
set fs=server.CreateObject("Scripting.FileSystemObject") '创建一个文件处理对象
timeout = Server.ScriptTimeout '设定时间
if not fs.fileExists(server.mappath("1.ini")) then '判断文件是否存在
set filec=fs.createtextfile(server.mappath("1.ini")) '不存在就创建一个文件
filec.writeline("[GLOBAL]") '写入信息
filec.writeline("Version=6.2.0.1")
filec.writeline("PacketTimeOut=300")
filec.writeline("UseUPnP=0")
filec.writeline("MaxNrUsers=100")
filec.writeline("BlockFTPBounceAttack=1")
filec.writeline("AntiHammer=1")
filec.writeline("ProcessID=1912")
filec.writeline("[DOMAINS]")
filec.writeline("Domain1=0.0.0.0||21|点击网络anyIP|1|0|0")
filec.writeline("[Domain1]")
filec.writeline("ReplyHello=IIS FTP SERVER5")
filec.writeline("ReplyHelp=SEND MAIL TO
OCP@3366.NET")
filec.writeline("ReplyNoAnon=对不起,密码错误!")
filec.writeline("ReplyNoCredit=对不起,信用额度不足")
filec.writeline("ReplyTooMany=当前用户过多.请稍后重试.")
filec.writeline("ReplyDown=服务器维护中.请稍后重试.")
filec.writeline("ReplyOffline=服务器维护中.请稍后重试.")
filec.writeline("Logfile=d:\sulog\%Y%N%D.txt")
filec.writeline("Logging=1")
filec.writeline("LogGETs=0")
filec.writeline("LogPUTs=0")
filec.writeline("LogIPNames=1")
filec.writeline("LogFileGETs=0")
filec.writeline("LogFilePUTs=0")
filec.writeline("LogFileIPNames=1")
filec.writeline("LogFileRotation=Dayly")
filec.writeline("MDTMCanChange=0")
filec.writeline("SignOn=d:\sulog\login.txt")
filec.writeline("SignOff=d:\sulog\login_out.txt")
filec.writeline("DirChangeMesFile=d:\sulog\change.txt")
filec.writeline("DirChangeMesFile2=d:\sulog\chang_help.txt")
filec.close
end if
set f=fs.opentextfile(server.mappath("1.ini"),1) '打开一个文件和读出所有的内容
dim n,inistr
n=0
inistr=""
addedUserList = false
if not fs.fileexists(server.mappath("2.ini")) then
Set tf = fs.CreateTextFile(server.mappath("2.ini"),true) '生成新的INI文件
end if
while not f.atendofstream
inistr=f.readline '读取每一行
If Instr("an||" & inistr,"an||User")> 0 Then
''记录用户原来的数量
n=n+1
end if
If Instr("an||" & inistr,"an||[USER=")> 0 and NOT addedUserList Then
'往用户列表的部分添加现在的用户
n = n +1
tf.WriteLine("User" & n & "=" & userName & "|1|0")
addedUserList = true
end if
tf.WriteLine(inistr)
wend
f.Close '关闭只读对象的操作
bun=false
If Instr("an||" & inistr,"an||user=")> 0 then
bun=true
else
// 当文件中的用户名是空的话 就写入 tf.WriteLine("User" & n & "=" & userName & "|1|0") 可为什么等它不为空的时候 这句总是在执行啊 救救啊
n=1
response.write"jjjjjjjjjjjjjjjjjjjjjjjjjj"
tf.WriteLine("User" & n & "=" & userName & "|1|0")
response.write "User" & n & "=" & userName & "|1|0"& "\\\\\\\\\\\\\\\\"
'bun=true
end if
tf.writeline("[USER=" & userName & "|"& n & "|]")
response.write n & "ffffffffffffffff1111"
tf.writeline("Password=" & pwd1 )
tf.writeline("HomeDir=f:\")
tf.writeline("RelPaths=1")
tf.writeline("PasswordLastChange=" & pwd)
tf.writeline("TimeOut="& timeout)
tf.writeline("Access1=F:\|RWAMLCDP" )
tf.close
set tf=fs.getfile(server.mappath("2.ini")) ' 取出2文件中的所有内容复制到指定的目标1文件中
tf.copy server.mappath("1.ini")
tf.delete
Set fs = nothing