@echo off
::::::::CN-DOS BBS Login {s11ss 2007-10-13}::::::::
setlocal enabledelayedexpansion
if "%1" equ "" (
echo 参数一:用户名,如user
echo 参数二:密码,如123456
echo 参数三:是否将当前文件夹下生成的文件cn-dos.hta移到收藏夹/m(移)或/f(不移)
echo 例如:%0 user 123456 /m
pause>nul
goto :eof
)
set u=%1
set p=%2
set a=%3
< "%~f0" more +44 >cn-dos.hta
set t=^>^>t.vbs echo
call :e %u%
set user=de^(array^(!encoded!^)^)
call :e %p%
set pwd=de^(array^(!encoded!^)^)
del t.t
set t=^>^>cn-dos.hta echo
%t% location="http://www.cn-dos.net/forum/logging.php?action=login"+"&"+"cookietime=0"+"&"+"username="+%user%+"&"+"password="+%pwd%+"&"+"loginsubmit=."
%t% close()
%t% ^</script^>
%t% ^<hta:application
%t% showInTaskBar=no
%t% /^>
if not "%a%" equ "/m" goto :eof
move cn-dos.hta "%userprofile%"\Favorites
goto :eof
:e
%t% for i=1 to len("%1")
%t% one=mid("%1",i,1)
%t% if i=1 then
%t% encoded=asc(one)+100*5+20
%t% else
%t% encoded=encoded^&chr(44)^&(asc(one)+100*5+20)
%t% end if
%t% next
%t% CreateObject("Scripting.FileSystemObject").CreateTextFile("t.t").write(encoded)
cscript //nologo t.vbs & del t.vbs
set/p encoded=<t.t
goto :eof
<script language="javascript">
window.moveTo(screen.width,screen.height);
</script>
<script language="vbscript">
function de(x)
decoded=x
for i=0 to ubound(decoded)
s=s&chr(decoded(i)-100*5-20)
next
de=s
end function