How can I have a button in my desktop application that causes the user's default browser to launch and display a URL supplied by the application's logic.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Process.Start([your url]) is indeed the answer, in all but extremely niche cases. For completeness, however, I will mention that we ran into such a niche case a while back: if you're trying to open a "file:\" url (in our case, to show the local installed copy of our webhelp), in launching from the shell, the parameters to the url were thrown out.
Our rather hackish solution, which I don't recommend unless you encounter a problem with the "correct" solution, looked something like this:
In the click handler for the button:
The ugly function that you shouldn't use unless Process.Start([your url]) doesn't do what you expect it's going to: