我无法使用登录名,我无法将用户名和密码存储到名为“ RootData”的文件夹中,然后可以将用户名和密码存储到.dll文件中(认为)。
set /p userName="user name?: "
set /p userNameConfim="confirm user name: "
if "%userName%" equ "%userNameConfim%" (
echo %userNameConfim% >> RootData\ProgramData.dll
)else(
echo something went wrong kek
)
但是这里出了错,(我认为)
:login
:begin
set usr=
set /p usr=Enter your username:
if {%usr%}=={} goto :begin
set authenticated=
for /f "tokens=*" %%a in (RootData\ProgramData.dll) do (
if {%%a}=={%usr%} set authenticated=true)
if not defined authenticated (
echo Invalid Username & goto :begin
)
完整代码:
https://gist.github.com/Occisio/bbe4f9e568c0c627f43f7da051185f22
不确定为什么。