我從鏈接http://www.robvanderwoude.com/vbstech_ui_password.php批量解析爲VBScript
在現有VBSscript複製一個VBScript我加入了代號爲「Internet Explorer版本」:
WS腳本 - 名爲Password.vbs(看到完整的劇本在上面的鏈接)
strPw = GetPassword("Please, type your password:")
Sub Submit_OnClick
Const ForWriting = 2
Dim filesys, filetxt, FormContent
Set FormContent = document.getElementById("strPw")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("c:\temp.txt", ForWriting, True)
filetxt.WriteLine(FormContent.value)
filetxt.Close
End Sub
批處理腳本
@echo off
SET VALIDPASSWORD=1234
wscript Password.vbs
findstr %VALIDPASSWORD% c:\temp.txt
if ERRORLEVEL 1 (
echo Incorrect password.
goto :EOF
) else (
echo Password correct.
)
echo Batch continues from here
pause
:EOF
exit /b
文件TEMP.TXT應發送到c:\與信息輸入的輸入框的用戶。該批次將讀取此輸入並與設定的密碼進行比較並繼續編碼...
我該怎麼做這項工作? temp.TXT是不會產生的...
BATCH和VBS大師們在那裏,任何幫助SOLVE這些問題真的很受歡迎!
您是否製作了一個名爲「strPw」和一個提交按鈕文本框一種形式「提交」? – Nilpo 2012-08-03 16:23:55
是的,我做過。請參閱上面鏈接的完整腳本。我沒有修改Vanderwoud的腳本,只是在原始腳本的頂部添加了上面的代碼。仍然有問題寫入temp.txt – 2012-08-04 20:30:25