x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

C# - get command line args

SwizzleDude
SwizzleDude Page Icon Posted 2017-03-17 11:31 PM
#
Status:
I'm writing an image view program in C# for .NET CF, and at the moment I'm trying to implement command line args, so that the program can be associated with image files and can open them upon double clicking.

I've tried String[] args = Environment.GetCommandLineArgs();, but it gives this error: 'System.Environment' does not contain a definition for 'GetCommandLineArgs'

Any thoughts?
 Top of the page
C:Amie Page Icon Posted 2017-03-18 3:05 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,952
Location:
United Kingdom
Status:
What .net Framework are you targeting? You need 1.1 or higher for the Environment namespace; and I assume you've included system.
 Top of the page
SwizzleDude
SwizzleDude Page Icon Posted 2017-03-18 3:16 PM
#
Status:
Quote
C:Amie - 2017-03-18 3:05 PM

What .net Framework are you targeting? You need 1.1 or higher for the Environment namespace; and I assume you've included system.

I'm targeting 2.0, on VS2005. I have included system
 Top of the page
C:Amie Page Icon Posted 2017-03-18 3:25 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,952
Location:
United Kingdom
Status:
Try refactoring you method
static void Main(string[] args) {}
 Top of the page
Jump to forum:
Seconds to generate: 0.156 - Cached queries : 60 - Executed queries : 8