troubleshooting Question

Extracting a hyperlink from the command line

Avatar of Andy Brown
Andy BrownFlag for United Kingdom of Great Britain and Northern Ireland asked on
C#
6 Comments1 Solution86 ViewsLast Modified:
I'm new to c# and need a bit of guidance on something that I fear is very obvious (but haven't figured out).  I want to pass a hyperlink via the command line to a variable called strHyperlink.  I was thinking of something like this for the command line:

D:\Testbed\Sandbox.exe http://website.com

I have added the variable to the Form class
string strHyperlink = Environment.CommandLine;

However, when I try to view the switch using the following:

var result = MessageBox.Show(strHyperlink, "Test", MessageBoxButtons.OK, MessageBoxIcon.Information);

I get:

"D:\Testbed\Sandbox.exe http://website.com"

Can someone please let me know how to get the hyperlink (in the cleanest possible way).  Thank you.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros