mlcm168 发表于 2007-9-11 16:43:00

[求助]文件操作出错

照着书上的例子做,为什么出错了。那位大侠能告诉我为什么啊?

mlcm168 发表于 2007-9-17 10:53:00

<p>怎么没有人帮助啊,大家都没遇到过这问题。</p>

烟雨.江南 发表于 2007-9-18 14:21:00

你确定你电脑的C盘Test目录下已经存在Temp.txt这个文件了吗?如果没有请自己创建这个文件然后再运行程序。

mlcm168 发表于 2007-9-19 21:25:00

<p>当然确定这个文件夹下有这个文件.</p>

fjfhgdwfn 发表于 2007-9-20 08:34:00

<p>C:\123  兄弟“\”反了吧。还有应是 AS #1 </p><p>细心点</p>

mlcm168 发表于 2007-9-21 15:49:00

本帖最后由 作者 于 2007-9-21 15:58:59 编辑 <br /><br /> <p>我改了还是一样的错误。</p><p>Public Sub test()<br/>Open "c:\test\temp.txt" For Append As 1#<br/>Dim a As Integer, b As Integer, c As Integer, d As String<br/>a = 1: b = 2: c = 3: d = "hello"<br/>Write #1, a, b, c, d, "world"<br/>End Sub</p>

zhang007 发表于 2007-9-21 17:20:00

<p>我试了一下,是没有c:\test这个文件夹</p>

mlcm168 发表于 2007-9-26 16:49:00

<p><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/></p><p>就是错误啊,真的不知道出了什么问题。我有test的这个文件夹啊。</p>

mlcm168 发表于 2007-9-26 16:50:00

<p><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/><img alt="" src="http://www.mjtd.com/bbs/Skins/default/topicface/face13.gif"/></p><p>就是不行啊,我明明有test这个文件夹啊。</p>

fjfhgdwfn 发表于 2007-9-26 17:34:00

<p>我改了还是一样的错误。</p><p>Public Sub test()<br/>Open "c:\test\temp.txt" For Append<font color="#ff0033"> As 1#&nbsp; 这样可以吗?感觉是#1吧&nbsp;</font><br/>Dim a As Integer, b As Integer, c As Integer, d As String<br/>a = 1: b = 2: c = 3: d = "hello"<br/>Write #1, a, b, c, d, "world"<br/>End Sub</p>
页: [1] 2
查看完整版本: [求助]文件操作出错