变量与shell应用
请高人帮小弟看看下面的编码有没有问题,我想点击“连接”就能自动配IP并连到我在局域网里的对应PC,
Private Sub Command1_Click()
Dim MyStrLine As String
Open App.Path & "\ip.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, MyStrLine
If Left(MyStrLine, 2) = Text1.Text Then
Exit Do
End If
Loop
Close #ip
Dim ipurl As String
ipurl = Right(MyStrLine, Len(MyStrLine) - 5)
Shell App.Path & "\vnc.exe " & ipurl & Chr(34), vbNormalFocus'这一句现在有问题,达不到自动配IP的效果
Dim longTimer As Long
longTimer = Timer
Do Until Timer - longTimer >= 1
DoEvents
Loop
SendKeys "{enter}"
SendKeys "stwhost"
SendKeys "{enter}"
End Sub