Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to run an exe with parameters
Message
 
À
08/01/2005 18:16:31
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
00975340
Message ID:
00975459
Vues:
17
Hi Bonnie

No offence taken... I appreciate all your very helpful replies.

Just sometimes it seems easier to post a question, where there may or may not be a simple reply.. I just dont know beforehand and could go off spending hours testing stuff out ,that onereply would give me the answer in a minute that would take me maybe hours.

An Example:

A recent thread (I think it may have gone onto about 20 entries) was enquiring why you cant say: If (c1 > c2) { Do Something}

Now , at the end of the day I think the answer was a One liner ,but it took quite a bit of time to arrive at it.


There just seems to be an awful lot to .net compared to VFP and when one is starting out, it makes sense sometimes to take the shortest path between two points !!

Regards,

Gerard




>Gerard,
>
>It's best to use spaces. A comma seems to be considered one of the parameters. You know, why don't you just mess around with it and try it out? I have never used this stuff myself, and the only reason I can answer your questions is because I just tried it to see what it would do. Certain types of questions lend themselves to simple exploration ... this is one of them. =)
>
>(I hope you don't take offense at my tone ... I don't intend to sound mean, but I realize that it might come across that way.)
>
>~~Bonnie
>
>
>>Hi Bonnie.
>>Thanks for that confirmation.
>>
>>Just one other point when passing in prameters
>>
>>Can they be separated with spaces or does it have to be commas ?
>>
>>Regards,
>>Gerard
>>
>>
>>>Gerard,
>>>
>>>As you realized, all parameters have to be string to begin with. You can always convert them if necessary.
>>>
>>>~~Bonnie
>>>
>>>
>>>
>>>>Hi Einar,
>>>>Thanks for your reply.
>>>>
>>>>Am I right then , say if you wanted to pass 3 paraneters you would call the program like:
>>>> MyProg.exe "Param1","Param2",100
>>>>(Asuming first two are Charcater parameters and third is Numeric
>>>>
>>>>And in main calling mehod it would be something like:
>>>> (Pardon the incorrect syntax)
>>>>
>>>> static void Main(string[] args)
>>>> if args[0] = "abc" { do something}
>>>> if args[2] = "def" {do smoethingB}
>>>> if args[3] = 100 {do something}
>>>>
>>>>
>>>>Just as I am writing this I notice i have a mix of types in the parameters !!is this going to cause a problem having 2 character parameters and 1 numeric .... can you have this in C# as you can in VFP ?
>>>>
>>>>
>>>>Regards,
>>>>Gerard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform