【发布时间】:2016-04-22 14:48:22
【问题描述】:
我想使用 VB 脚本写入文本文件并尝试使用:
My.Computer.FileSystem.WriteAllText("C:\Users\Internet\test1.txt","This is new text to be added",True)
我收到错误 -
"Cannot use parenthesis when calling a sub".
如果我删除括号,我会得到错误 -
Object required: 'My'
没有运气搜索帮助论坛。 我正在使用Windows Vista。我会错过一些图书馆吗?
非常感谢任何帮助。
【问题讨论】:
-
VB.NET 和 VBScript 是两个非常不同的东西。您显示的代码是 VB.NET。如果您想使用 VBScript,那么您需要编写 VBScript 代码。
-
谢谢。你能告诉我一个用 VB 脚本编写文本文件的例子吗?
-
再次感谢。找到了一些 VB Script 文件编写示例,现在正在某处。非常感谢。