Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Dear Friends,
 
I have created a window based application to get dates(From Date and To Date) which compares the Booking Date from the database and result will be displayed on Crystal report Viewer.
 
I created an exe file of it and tried to execute on Command Prompt. But i am not getting how to get those parameter in Form_Load event(crystalReportViewer1_Load).
 
Can anyone please help to solve this....
 
My command-line will be
 
c:> testRptExe '18/12/2012' '26/12/2012'
Posted 18-Dec-12 17:27pm
Edited 18-Dec-12 17:38pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This makes no sense at all. If it's windows based, there is no code behind and it's not ASP.NET. If it's a windows app, the parameters are passed in to the entry point as an array. And, your question therefore is nonsensical
  Permalink  
Comments
Member 9501115 at 18-Dec-12 23:37pm
   
I am Sorry... I don't have much idea abt Window based app's. I thought the Form_Load() method will be the code-behind . So i used that word.. But i need solution for question!!!
Christian Graus at 18-Dec-12 23:41pm
   
Despite your question being a nonsense, I answered it. The entry point for your app is passed a collection of strings, that is the command line parameters. I don't have a windows based app open, but I think it's Program.cs that it lives in. Look for a Main method.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

you can use this to read command line arguments from non-main method
foreach (string arg in Environment.GetCommandLineArgs())
{
    Console.WriteLine(arg);
}
  Permalink  

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

  Print Answers RSS
0 Maciej Los 225
1 Sergey Alexandrovich Kryukov 167
2 _Amy 155
3 CHill60 130
4 Manfred R. Bihy 130
0 OriginalGriff 7,320
1 Sergey Alexandrovich Kryukov 6,043
2 Maciej Los 3,754
3 Peter Leow 3,448
4 CHill60 2,572


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100