Private Sub Form_Load()'  win_path$ = WindowsDirectory()
  win_path$ = "c:\windows"
  ChDrive Left$(win_path$, 3)
  ChDir Right$(win_path$, Len(win_path$) - 2)
Open "rss.ini" For Input As #1
  Input #1, temp$  'skip the first line
'  Input #1, Path_home$
  Close #1
  Path_drive$ = Mid$(Path_home$, 1, 2)
'  Path_dir$ = Right$(Path_home$, Len(Path_home$) - 2)
  ChDrive Path_drive$
'  ChDir Path_dir$
  
 上面加颜色行显示有错误,我屏蔽了这些错误,程序可以通过,但还是有问题。

解决方案 »

  1.   

     Open "rss.ini" For Input As #1 
     Input #1, Path_home$ 
     Path_dir$ = Right$(Path_home$, Len(Path_home$) - 2)
     ChDir Path_dir$  
    主要是这四句,是不是程序需要rss.ini文件,但是我系统里没有这个文件呀。
      

  2.   

    代码是要打开rss.ini文件,程序目录里没有当然会报错,这个就是文本文件,自己手工建一个
      

  3.   

    一般先用Dir函数判断一下有无这个文件啊.你这种情况,可能还需进一步判断文件格式及内容是不是符合要求
      

  4.   

    我在系统目录下新建了rss.ini 配置文件,0KB,后
    Open "rss.ini" For Input As #1   这句通过,
    但下面还有问题:
    Input #1, Path_home$ 
    Path_dir$ = Right$(Path_home$, Len(Path_home$) - 2) 
    ChDir Path_dir$ 是不是这个文件与源文件不匹配呀。
      

  5.   

    我新建了rss.ini 配置文件,里面添加了我的程序目录信息,打开文件可以通过了,
    但这句
    ChDrive Path_drive$ 
    还有点问题。
      

  6.   

    ChDrive Path_drive$你这个是不是要制定驱动器???