我的问题
我在这里不断收到错误,该程序的目标是读取我制作的文件类型(.ptaf 纯文本存档格式),但它一直返回此错误:
变量未定义:“输入”
编码
Option Explicit
Const conForReading = 1
'Declare variables
Dim objFSO, objReadFile, contents
问题领域
'Input
Input = InputBox("Please enter the path of the file you want to open:", _
"Open Plain Text Archive File File")
'Set Objects
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("C:\MyArchives\"& Input.Value , 1, False)
问题区域结束
'Read file contents
contents = objReadFile.ReadAll
'Close file
objReadFile.close
'Display results
wscript.echo contents
'Cleanup objects
Set objFSO = Nothing
Set objReadFile = Nothing
Thanks,
-------
Mr.Minecrafter
--------------