Solved

command line argument

Posted on 2011-02-18
3
279 Views
Last Modified: 2012-06-21
Hi, Have a look at this Main function in my .Net windows application:

static void Main(string[] args)
        {
            try
            {
                if (args.Length == 2)
                {
                    DDIManager dDIManager;

                    DDIManager.DatabaseServer = args[0].Trim();
                    DDIManager.DatabaseName = args[1].Trim();

                    Logger.Information("Working with database '" +
                        DDIManager.DatabaseServer + "\\" +
                        DDIManager.DatabaseName + "'");

                    dDIManager = new DDIManager();
                    //dDIManager.ProcessReturnedAUDDACInstructions();
                    //dDIManager.ProcessReturnedARUDDInstructions();
                    //dDIManager.ProcessReturnedAUDDISInstructions();
                    dDIManager.ProcessNewDDIs();
                    dDIManager.ProcessAmendedDDIs();
                }
                else
                {
                    Help("Invalid parameters");
                    LogHelp("Invalid parameters");
                }
            }
            catch (Exception exp)
            {
                Logger.Error(exp);
            }
        }
I have been looking into whole solution to find the connection string for this project but found nothing. But by the looks of it this must be paased as a command line argument and, if that is the case where do I find what has been passed?

Is that the location where this executable is running from.
0
Comment
Question by:ube100
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
himanshut earned 125 total points
ID: 34924845
just put a breakpoint in front of
Logger.Information("Working with database '" +
                        DDIManager.DatabaseServer + "\\" +
                        DDIManager.DatabaseName + "'");
and when the execution comes at this line, just hover the mouse pointer over these values to get the names
OR right click on

                    DDIManager.DatabaseServer = args[0].Trim();
                    DDIManager.DatabaseName = args[1].Trim();
Args, and add quick watch to get the values.

They are coming from DDIManager dDIManager;
0
 
LVL 3

Assisted Solution

by:imaki06
imaki06 earned 125 total points
ID: 34924847
You are right, this program gets database server and database name values from command line arguments.

You could try to check the shortcut which is used to start this program, and see if there is comman line arguments. Or if it is a batch (.bat) file, that file can be opened with notepad to see the arguments.
0
 

Author Closing Comment

by:ube100
ID: 34991590
Helps me in some way.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question