AngryHacker
AngryHacker

Reputation: 61616

Is there a way to read the command line parameters from a library?

I want to get the equivalent of string[] args in a library several layers down from the main exe. Is there anyway to do this? I don't see anything obviuos.

Upvotes: 0

Views: 83

Answers (2)

Dylan Roux
Dylan Roux

Reputation: 63

Environment.GetCommandLineArgs()

Upvotes: 3

Andy
Andy

Reputation: 4097

Use this:

string[] args = Environment.GetCommandLineArgs();

Upvotes: 6

Related Questions