vb6.0中如何描述根目录文件位置?
答案:2 悬赏:10 手机版
解决时间 2021-02-23 07:43
- 提问者网友:萌卜娃娃
- 2021-02-23 00:20
vb6.0中如何描述根目录文件位置?
最佳答案
- 五星知识达人网友:大漠
- 2021-02-23 01:01
& App.Path & "\123.txt追问If c = s Then
Kill "& app.path & " \ mima.inf
Open "& app.path & " \ mima.inf For Output As #1
Print #1, ""
Close #1
错误提示在KILL一行,如何解决?谢谢!追答Kill App.path & " \ mima.inf "
Open App.Path & "\6.txt" For Random As #1
Kill "& app.path & " \ mima.inf
Open "& app.path & " \ mima.inf For Output As #1
Print #1, ""
Close #1
错误提示在KILL一行,如何解决?谢谢!追答Kill App.path & " \ mima.inf "
Open App.Path & "\6.txt" For Random As #1
全部回答
- 1楼网友:你哪知我潦倒为你
- 2021-02-23 02:02
先查找U盘盘符,如果是U盘,判断是否有123.txt这个文件:Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Function USBDISK()
Dim i As Long
For i = Asc("A") To Asc("Z")
If GetDriveType(Chr(i) + ":") = 2 Then
Text1 = Chr(i) & ":"
On Error GoTo erdisk
If Dir(Chr(i) & ":123.txt") <> "" Then
'找到了,执行你想要的代码
End If
erdisk:
End If
Next i
End Function
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯