English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

這是我寫的@@

Form3....
Private Sub Command1_Click()
Form2.Show
Form2.Label4 = Form3.Label8 & "\\" & Form3.Label9
Form3.Hide
End Sub

Private Sub Command2_Click()
Form3.Hide
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
Label8 = Dir1.Path
Label9 = ""

End Sub

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

Private Sub File1_Click()
Label9 = File1.FileName
End Sub
------------------------分隔線!!--------------------------------------
Form2

Private Sub Command1_Click()
If Label4.Caption = "" Then
MsgBox "你尚未設定遊戲目錄!", 6, "遊戲目錄未設定"
GoTo 1
End If

If Text1.Text = "" And Text2.Text = "" Then
MsgBox "你尚未輸入帳號&密碼", 6, "帳號&密碼未輸入"
GoTo 1
End If

If Text1.Text = "" Then
MsgBox "你尚未輸入帳號", 6, "帳號未輸入"
GoTo 1
End If

If Text2.Text = "" Then
MsgBox "你尚未輸入密碼", 6, "密碼未輸入"
GoTo 1
End If


If Label4.Caption = Form3.Label8 & "\\" & Form3.Label9 Then
Shell "Form3.Label8 & "\\" & Form3.Label9" <~~~問題的地方@@ 因為我不太會敘述問題!!所以請各位大大辛苦= =
End If
1:
End Sub

Private Sub Command3_Click()
Form3.Show
End Sub

20點.......

2006-10-08 06:27:51 · 3 個解答 · 發問者 Anonymous in 電腦與網際網路 程式設計

回 cgsjh :
沒辦法...他還是出現....
執行階段錯誤 "13":
語態不符

2006-10-08 10:55:09 · update #1

回: W.J.S.
還是沒辦法>"< 快瘋了!! 還是說 我還有其他地方?有錯誤??

如果有!! 請幫我檢查 謝謝!!

2006-10-09 06:25:09 · update #2

回: W.J.S.
謝謝你喔!! 問題解決了!!! 謝謝喔!!

2006-10-09 14:33:12 · update #3

3 個解答

'Shell只能執行程式(.exe)你要執行其他的檔案就須用ShellExecute這個API函數'底下在Form2Private Declare Sub ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal H&, ByVal L$, ByVal F$, ByVal P$, ByVal D$, ByVal C&)Private Sub Command1_Click()    If Label4.Caption = "" Then       MsgBox "你尚未設定遊戲目錄!", 6, "遊戲目錄未設定"       Exit Sub    End If        If Text1.Text = "" And Text2.Text = "" Then       MsgBox "你尚未輸入帳號&密碼", 6, "帳號&密碼未輸入"       Exit Sub    End If        If Text1.Text = "" Then       MsgBox "你尚未輸入帳號", 6, "帳號未輸入"       Exit Sub    End If        If Text2.Text = "" Then       MsgBox "你尚未輸入密碼", 6, "密碼未輸入"       Exit Sub    End If        If Label4.Caption = Form3.Label8 & Form3.Label9 Then       If Dir(Label4) <> "" Then ShellExecute 0, vbNullString, Label4, "", "", vbNormalFocus    End IfEnd SubPrivate Sub Command3_Click()  Form3.ShowEnd Sub'底下在Form3,順便更改你一些BugPrivate Sub Command1_Click()    Form2.Show    Label8 = IIf(Right(Label8, 1) = "\", Label8, Label8 & "\")    Form2.Label4 = Label8 & Label9    HideEnd SubPrivate Sub Command2_Click()    HideEnd SubPrivate Sub Dir1_Change()    File1.Path = Dir1.Path    Label7 = Drive1.Drive    Label8 = Dir1.Path    Label9 = ""End SubPrivate Sub Drive1_Change()    Dir1.Path = Drive1.Drive    Label7 = Drive1.Drive    Label8 = Dir1.Path    Label9 = ""End SubPrivate Sub File1_Click()    Label9 = File1.FileNameEnd Sub

2006-10-08 15:39:54 · answer #1 · answered by W.J.S. 7 · 0 0

假設你開起的是執行檔的話
Windows內的"計算機"程式來試驗是ok的
Form3...
Label8.Caption = "C:"
Label9.Caption = "WINDOWS\system32\CALC.EXE"

Main...
Form3.Hide
If Label4.Caption = Form3.Label8.Caption & "\" & Form3.Label9.Caption Then
Shell (Form3.Label8.Caption & "\" & Form3.Label9.Caption)
End If

2006-10-09 09:21:44 · answer #2 · answered by Money 5 · 0 0

我在想你的問題的地方
是要去某一個目錄裡
執行一個程式
你的問題可能是
程式路徑的問題
你先在
Shell "***" & "Form3.Label8 & "\" & Form3.Label9"
我打*號的地方打入
你程式的絕對路徑
試試看
再去研究如何讀出你程式的絕對路徑
OK??????

2006-10-08 10:39:08 · answer #3 · answered by cgsjh 2 · 0 0

fedest.com, questions and answers