Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

command line argument

Posted on 2011-02-18
3
Medium Priority
?
281 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 375 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 375 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

663 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