如何使用VB.NET中的按钮打开URL [英] How can I open a url using a button in VB.NET
本文介绍了如何使用VB.NET中的按钮打开URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是,我必须点击一个按钮打开一个URL。这个URL包含一些变量和常量字段。
任何人都可以在vb.net给我这个代码
我尝试了什么:
我的问题是,我必须通过点击按钮打开一个URL。这个URL包含一些变量和常量字段。
你可以在vb.net中给我代码吗
解决方案
Dim url As String =http://www.kgm.in
Process.Start(url)
使用目标URL作为命令参数创建一个新的ProcessStartInfo对象,并将ShellExecute设置为True。
Dim URL as String = http://www.codePrject.Com
Dim NewProcess As Diagnostics.ProcessStartInfo = 新 Diagnostics.ProcessStartInfo(URL)
NewProcess.UseShellExecute = True
Diagnostics.Start(NewProcess)
' 如果您需要阻止该流程退出,请取消注释e以下行
' NewProcess.WaitForExit()
My question is, I have to open a URL by clicking on a button. This URL contains some variable and constant fields.
can anybody please give me code for this in vb.net
What I have tried:
My question is, I have to open a URL by clicking on a button. This URL contains some variable and constant fields.
can you please give me code for this in vb.net
解决方案
Dim url As String = "http://www.kgm.in" Process.Start(url)
Create a new ProcessStartInfo object with the target URL as the command argument and set ShellExecute to True.
Dim URL as String="http://www.CodePrject.Com" Dim NewProcess As Diagnostics.ProcessStartInfo = New Diagnostics.ProcessStartInfo(URL) NewProcess.UseShellExecute=True Diagnostics.Start(NewProcess) 'If you need to block until the process exits, uncomment the following line 'NewProcess.WaitForExit()
这篇关于如何使用VB.NET中的按钮打开URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文