About send a string to a C# app

  • Thread starter Thread starter cfyam
  • Start date Start date
Hi,

Modify your Main method to accept a string array.
Checkout this code snippet:

static void Main(string[] args)
{
if (args.Length > 0)
{
//check the arguments
if (args[0].ToLower().Trim().Substring(0,2) == "/c")
{
...
}
else // there are no arguments
{
...
}
}

HTH,
Rakesh Rajan
 
hi
change your Main to
static int Main(string[] args)
which takes string arguements

now when you start your application you can pass arguements from the command
line

regards
Ansil
Dimensions
Technopark
Trivandrum
(e-mail address removed)
 
Back
Top