您的位置:程序门 -> vb -> 基础类



怎么回事?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


怎么回事?
发表于:2007-09-21 15:57:39 楼主
一个代码:
private   sub   command1_click()
dim   tmp   as   string
open   "c:\my   documents\gmail.txt "   for   input   as   #1
open   "c:\my   documents\gmail2.txt "   for   output   as   #2
do   while   not   eof(1)
line   input   #1,   tmp
if   instr(1,   trim(tmp),   "操作历史报告 ")   >   0   then
exit   do
if   instr(1,   tmp,   "members/earn.php? ")   >   0   then
print   #2,   tmp
chr   (13)   &   chr(10)
end   if

close   #1
close   #2
end   if
loop
end   sub  

遇到实时错误   文件无法打开

调试后黄色显示在:
open   "c:\my   documents\gmail.txt "   for   input   as   #1  

我思来想去很久,代码的逻辑应该没什么错误,怎么会发生这种情况?请大家指点一下,不胜感激。
发表于:2007-09-21 20:49:321楼 得分:0
你看看是不是这语句open   "c:\my   documents\gmail.txt "   for   input   as   #1   有没有中英文的错误.
发表于:2007-09-22 00:36:142楼 得分:0
你路径是否正确阿
c:\my   documents\
一般my   documents都不在c根目录下的
你检查一下
发表于:2007-09-22 08:13:333楼 得分:0
通常出在路径上
发表于:2007-09-23 09:54:224楼 得分:0
谢了,朋友
发表于:2007-09-23 12:48:125楼 得分:0
先用dir()试一下文件是否存在


快速检索

最新资讯
热门点击