I'm creating a console program that reads in a list of strings. It works fine when I'm entering my data as command line arguments, but I want to know if it is possible to read in the command line arguments from a file? If so, how do I do it?

Hi,

In the main function of your application, before doing any processing, open your file and take the values you need. You can further load those values into the args array(so you don't change the code you wrote).
For an extension, you can send in command line the path to the file.

void main(string[] args)
{
   //open file and take the values 
...
//your current code 
}

If you are not familliar with System.IO namespace, here you may found usefull information. Take a look to FileStream class.

Cheers,
Ionut

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.