<% dim ModuleName,InfoID,ChannelShortName,CorrelativeArticle,InstallDir,ChannelDir,Keyword,PageTitle,ArticleIntro,Articlecontent Keyword=stripHTML("WEB,ASP,FSO") PageTitle=stripHTML("在线修改Serv-U 4.2用户密码") ArticleIntro=stripHTML("") Articlecontent=stripHTML("以下代码在Serv-U 4.2上测试有效               <%                |##########################…") ModuleName = stripHTML("classical") InfoID = stripHTML("26155") ChannelShortName=stripHTML("文章") InstallDir=stripHTML("http://www.77169.com/") ChannelDir=stripHTML("classical") %> 在线修改Serv-U 4.2用户密码 - 华盟网 - http://www.77169.com
您现在的位置: 华盟网 >> 知识库 >> WEB开发 >> ASP >> FSO专题 >> 正文

在线修改Serv-U 4.2用户密码

2005/8/29 作者:unknown 来源: unknown
导读 <% if len(ArticleIntro)<3 then Response.Write Articlecontent 'Response.Write "Articlecontent" else Response.Write ArticleIntro 'Response.Write "ArticleIntro" end if %>


以下代码在Serv-U 4.2上测试有效

<%

' |###########################|
' | 网海求生者QQ:54883661 |
' | mail:wuyingke5155@163.com |
' |###########################|

inipath="D:\Program Files\Serv-U\ServUDaemon.ini" '设置ServUDaemon.ini文件路径
user="[USER="&request("user")&"|1]"
pass="Password="&request("pass")
key=request("key")
if key<>"" then
dim os,userlong,passlong,pl,s,ss
Set fso=CreateObject("scripting.FileSystemObject")
set os=fso.opentextfile(inipath,1) '读取ServUDaemon.ini
s=os.readall
os.close

userlong=instr(s,user)+len(user)+2
for i=userlong to userlong+20
passlong=passlong+1
if asc(mid(s,i,1))=13 then
exit for
end if
next

pl=mid(s,userlong,passlong-1)
ss=Replace(s,user&chr(13)&chr(10)&pl,user&chr(13)&chr(10)&pass)
set os=fso.createtextfile(inipath,true) '写入ServUDaemon.ini
os.write ss
os.close
end if
%>
<form method="post">
用户名:<input type="text" name="user"><br>
新密码:<input type="text" name="pass"><br>
<input type="submit" name="key" value="修改"><br>
</form>