如何让Text1等于连接地址!
VB嵌入问题
答案:3 悬赏:70 手机版
解决时间 2021-04-28 06:32
- 提问者网友:人傍凄凉立暮秋
- 2021-04-27 12:21
最佳答案
- 五星知识达人网友:刀戟声无边
- 2021-04-27 13:53
把原来的代码都清除,重新添加如下代码,就能达到你想要的效果了
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Form_Load()
Text1.Text = " http://www.baidu.com/"
End Sub
Private Sub Command1_Click()
If Len(Trim(Text1.Text)) Then
Call ShellExecute(Me.hwnd, "open", Trim(Text1.Text), vbNullString, vbNullString, &H0)
End If
End Sub
全部回答
- 1楼网友:胯下狙击手
- 2021-04-27 16:02
Dim a as integer
Private Sub Command1_Click()
Text1.Text
Shell "explorer " & Text1.Text
End Sub
只要你在text1.text中写入地址就可以了。
- 2楼网友:逐風
- 2021-04-27 15:09
Dim a
Private Sub Command1_Click()
a = Text1.Text
Shell "explorer " & a, 0
End Sub
Private Sub Form_Load()
Text1.Text = " http://www.baidu.com/"
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯