Home > Blockchain >  (SOLVED) Visual Studio 2019 Open URL In Browser Using VB
(SOLVED) Visual Studio 2019 Open URL In Browser Using VB

Time:11-18

I am trying to use a LinkLabel to direct users of my program to my Discord server (so they can report bugs and whatnot), but every time I click on it I get an error saying 'The system cannot find the file specified.'

I was using Process.Start("INVITE LINK") as that was the code I found in the vast majority of results I got when I Googled the issue. However, it would seem that this doesn't work in Visual Studio 2019, as evidenced by the error I get. Either that, or I've overlooked something (which wouldn't be the first time, as I kind of have a habit of not reading things properly).

I'm sure I've managed it before, but I can't for the life of me remember how it was done; I'm asking here in the hope that someone can push me in the right direction. Thanks in advance.

CodePudding user response:

Taken from an answer in c#,

using System.Diagnostics;
Process myProcess = new Process();
myProcess.StartInfo.UseShellExecute = true; 
myProcess.StartInfo.FileName = "https://discord.gg/(invite code goes here)";
myProcess.Start();

It's not much different in vb

Imports System.Diagnostics
Dim myProcess = New Process()
myProcess.StartInfo.UseShellExecute = True
myProcess.StartInfo.FileName = "https://discord.gg/(invite code goes here)"
myProcess.Start()
  • Related