VB上传文件程序查错 25
我想用VB结合ASP做个文件上传的程序,可是用这个的时候老是出错,高手帮我找找原因和如何解决?DimInPutFileAsStringDimOutPutFileAsStr...
我想用VB结合ASP做个文件上传的程序,可是用这个的时候老是出错,高手帮我找找原因和如何解决?
Dim InPutFile As String
Dim OutPutFile As String
Private Sub cmdChoose_Click()
CommonDialog1.ShowOpen
InPutFile = CommonDialog1.FileName
txtFileLoad.Text = InPutFile
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdUpload_Click()
If InPutFile = "" Then
MsgBox "Choose a File first!"
Exit Sub
End If
OutPutFile = GetNameFromFilePath(InPutFile)
FileCopy InPutFile, App.Path & "\" & OutPutFile & ""'这句出错:实时错误70,拒绝的权限
MsgBox "The File has already uploaded!"
End Sub
Private Sub Form_Load()
InPutFile = ""
txtFileLoad.Text = "Choose The File"
cmdChoose.Caption = "Choose"
cmdUpload.Caption = "Upload"
cmdExit.Caption = "Exit"
txtFileLoad.Enabled = False
End Sub
'下面程序看不懂,最好帮我注释一下谢谢。
Public Function GetNameFromFilePath(ByVal strFullPath As String, Optional ByVal strSplitor As String = "\") As String
Dim thePath As String
thePath = Left$(strFullPath, InStrRev(strFullPath, strSplitor, , vbTextCompare))
GetNameFromFilePath = Mid(InPutFile, Len(thePath) + 1, Len(InPutFile))
End Function 展开
Dim InPutFile As String
Dim OutPutFile As String
Private Sub cmdChoose_Click()
CommonDialog1.ShowOpen
InPutFile = CommonDialog1.FileName
txtFileLoad.Text = InPutFile
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdUpload_Click()
If InPutFile = "" Then
MsgBox "Choose a File first!"
Exit Sub
End If
OutPutFile = GetNameFromFilePath(InPutFile)
FileCopy InPutFile, App.Path & "\" & OutPutFile & ""'这句出错:实时错误70,拒绝的权限
MsgBox "The File has already uploaded!"
End Sub
Private Sub Form_Load()
InPutFile = ""
txtFileLoad.Text = "Choose The File"
cmdChoose.Caption = "Choose"
cmdUpload.Caption = "Upload"
cmdExit.Caption = "Exit"
txtFileLoad.Enabled = False
End Sub
'下面程序看不懂,最好帮我注释一下谢谢。
Public Function GetNameFromFilePath(ByVal strFullPath As String, Optional ByVal strSplitor As String = "\") As String
Dim thePath As String
thePath = Left$(strFullPath, InStrRev(strFullPath, strSplitor, , vbTextCompare))
GetNameFromFilePath = Mid(InPutFile, Len(thePath) + 1, Len(InPutFile))
End Function 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询