Thread: command line parameters

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    184

    command line parameters

    Hello again fellow programmers,

    I am trying to figure out a C# problem. I want to call a C# program while passing a parameter to it. It will be a windows program. This parameter will be a filename. How can I get the parameter from the main method that it enters the program at to the Form_Load event, or any other event at that. If I try passing it as a parameter, I will have to pass it through about 3 to 4 methods. Do I need to declare a static string variable in the class and store the parameter passed into the main method into that static string variable????????????????
    Or is there another way?????????????

    Thanks,
    Kendal

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    28

    Wink

    Greetings,

    Try: System.Environment.GetCommandLineArgs()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parameters quick Question
    By lifeis2evil in forum C++ Programming
    Replies: 2
    Last Post: 11-18-2007, 11:12 PM
  2. function with variable number of parameters
    By mikahell in forum C++ Programming
    Replies: 3
    Last Post: 07-23-2006, 03:35 PM
  3. Additional parameters for operator delete
    By darksaidin in forum C++ Programming
    Replies: 0
    Last Post: 09-21-2003, 11:46 AM
  4. Passing parameters from VB to C++ through ActiveX DLL
    By torbjorn in forum Windows Programming
    Replies: 0
    Last Post: 12-10-2002, 03:13 AM
  5. command-line parameters.
    By Tombear in forum C Programming
    Replies: 2
    Last Post: 10-28-2001, 08:40 AM