vb为什么提示实时错误75呢

来源:百度知道 编辑:UC知道 时间:2024/05/17 04:35:37
Option Explicit
Dim fn As String
Dim ByteBuffer As Byte

Private Sub Command1_Click()
MsgBox fn
MsgBox DigestStrToHexStr("fn")
Open fn For Binary Access Read As #1
Put #1, , ByteBuffer
Close #1
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
fn = Dir1.Path & "\" & File1.FileName
MsgBox fn
End Sub

就这一段老提示实时错误75,路径/文件访问错误,为什么呢?
lzh741206 我用了你的那段代码也还是出实时错误75
_狗狗_mua你那段是驴头不对马嘴吧……也不看我的代码直接贴别人的提问的。

Open fn For Binary Access Read As #1
Put #1, , ByteBuffer
Close #1

上面的要用get的,put改成get

你打错变量名了
FilmName$ = InputBox("F:\Users\jason\Desktop\新建文件夹(2)")
Open FileName$ For Input As #1
上面是filmname,下面是filename

不显式声明变量的坏处

Private Sub File1_Click()
If Right(File1.Path, 1) = "\" Then
fn = File1.Path & File1.FileName
Else
fn = File1.Path & "\" & File1.FileName
End If
MsgBox fn
End Sub