Results 1 to 16 of 16

Thread: args.length doesnt work!

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    args.length doesnt work!

    hi there.

    in my C# app, I have this:

    Code:
    static void Main(string[] args)
    {
    if(args.length == 0)
    {
      Application.Run(new Form1())
    }
    else
    {
      Console.WriteLine("args specified!");
    }
    }
    now, if i try to run this application through a command console and specify arguments, nothing happens - it doesnt display any text on the console.

    if i do not specify any arguments, the application works fine and loads the form - great.

    If i try to debug within VS.NET 2003, and specify arguments, it shows me the args specified! message

    the interesting thing is, if i do a messageBox.show() instead of Console.Writeline - it shows the message box! (with args given to the application)

    any idea what is going on? and yes, i have tried both the release and debug build types

    thanks!
    Last edited by Techno; Jun 20th, 2005 at 08:09 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width