Exe with arguments
hi everybody,
I am suppose to create a exe. This particular exe will be used by java developers so what i need to do is to build this exe in such a way that when i run that exe from command prompt with argument it should execute and the o/p or results to be in a file.
For some processing i need yo use ocx so i am not able to use the console type of application. I use this windows application project type.
Note: I know how to use a ocx n reading and writing to a file. I just need some code snippet of how to create such a exe that will take argument and execute
Eg: ExeName arguments.
swatantra singhPosted Jan 23, 2007, 2:10 AM
Scott LyslePosted Jan 23, 2007, 1:27 AM
static void Main(string[] args)
{
for(int i=0; i
string filePath;
filePath = args[i].ToString();
// do something with the filePath (or whatever was passed in)...
You can also collect the command line arguments using Environment.GetCommandLineArgs() if you need the args elsewhere in the application.