Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
For example my application is already running.
Now I want to find the argument of it.
Posted
Comments
Dave Kreskowiak 12-Mar-15 16:24pm    
You're going to have to go into far more detail than that. Are you talking about the code in your app needing the command line parameters that launched it?
saber rezaii magham 12-Mar-15 16:30pm    
Yes, nearly!
AmitGajjar 12-Mar-15 17:04pm    
Do you want to see argument passed in Main function ?
saber rezaii magham 13-Mar-15 0:40am    
Yes exactly.
I want to see the argument in the process that is already is ruining.
AmitGajjar 13-Mar-15 8:42am    
If you need to know argument inside main function, its just reading args variable. If you need to see that outside main function, you need to copy parameters in some global variable and access that global variable from wherever you want.

Hope this is what your looking for.

1 solution

Please see my article: Enumeration-based Command Line Utility[^].

You don't have to use my utility. It might be enough for you just to find out how the command line arguments are passed to 1) entry-point (Main), 2) System.Environment.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900