Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass a parameter to my .net exe?
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01318881
Message ID:
01318898
Views:
19
That's exactly what the "String args[]" parameter is for on you main method. The program will take parameters passed in when you call the program and create an array of them as strings. You can cast them as necessary if you need ints, etc.

>I have a very simple .net application. It's just one screen with the crystal report control on it.
>
>Right now, I have an "open report" button I made that has some code in it like this:
>
>dlgOpen.InitialDirectory = @"c:\";
>dlgOpen.Filter = "Crystal Report|*.rpt|All|*.*";
>if (dlgOpen.ShowDialog() == DialogResult.OK)
>{
> crystalReportViewer1.ReportSource = dlgOpen.FileName;
>}
>
>
>...what I want to do is avoid the need for the user to have to click the 'open file' button, and just pass the name of the report with the exe. so in foxpro, I could do something like this:
>
>Run /n MyNetCRapp.exe myreportnme.rpt
>
>
>...since I'm not up on C# yet I don't have a clue how to do ths..anyone have any ideas?
>
>Thanks!

(On an infant's shirt): Already smarter than Bush
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform