Solved

command line argument

Posted on 2011-02-18
3
274 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now