How to open a link from .txt file in c#?
I want to open a link from a .txt file, How can I do that?
24 Replies
I mean a link to website
read the link and then System.Diagnostics.Process.Start(yourLinkAsString);
try Process.Start("cmd.exe", $"start {linijka}");
Process.Start("cmd.exe", $"start \"{linijka}\"");
Stack Overflow
How to open a URL that contains an ampersand & with start command?
I already know that to open a webpage with the default browser you use:
start www.google.com. However, I'm trying to open a URL that contains a '&' in it for example:
https://www.google.dz/?gws...
Element "linijka" can have null value in this place
you'Re missing the \
edited, discord unescaped the quotes
ah wait
still doesnt work
i will try this one
@Grafek @AVVI don't do that
$useshellexecute
this is the correct way
(and is what
start
in cmd does anyhow)
this also works for starting files, or any other sort of linkem okay but when "https:" can I just give a string instead?
well it needs to be a fully valid link
it works
like just
www.google.com
won't work, b/c it won't know if that's supposed to be a file, or some sort of protocol handler
but https://www.google.com
tells it "oh, this is a web link, let's open your default browser"Ik i just wrote only a start of this what u wrote bc I am lazy ass
btw thanks for help