Private Sub Command2_Click()
Dim SourceFile, DestinationFile
SourceFile = App.Path & "\1.txt"
DestinationFile = "c:\"
If Check1.Value = 1 Then
FileCopy SourceFile, DestinationFile
End If
End Sub
提示找不到檔案路徑,我除錯看了下SourceFile, DestinationFile兩個值都是正確的啊
uj5u.com熱心網友回復:
SourceFile = App.Path & "\1.txt"
DestinationFile = "c:\1.txt"
FileCopy SourceFile, DestinationFile
uj5u.com熱心網友回復:
Win7 下對系統盤的權限控制更嚴格,普通權限不能在 C:\ 上寫檔案吧。uj5u.com熱心網友回復:
換D:\再試試。uj5u.com熱心網友回復:
如果一定要C盤,請先以管理員權限運行程式uj5u.com熱心網友回復:
這是一個老問題了,如果是放到根目錄底下的,要減一個"\",如果是兩個肯定不正確。我一般都是 if len(app.path)=3 then SourceFile = App.Path & "1.txt"
你可以試試
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/72142.html
標籤:VB基礎類
上一篇:ActiveX DLL免注冊呼叫
下一篇:VB6如何去除指定文字
