Author |
Message |
alex boul #1 / 11
|
 Question about how to call an .exe file from C#
Hello, I am really new to programming in general but I have this project where I need to use C# and I can't figure out something. The way it works, I need to run an executable file and take a text file as input. According to the documentation , from DOS, I would simply have to type the following: C:/program_name.exe C:/program_command.txt This is pretty much the same way in Matlab by the way. Does anyone know how to do this in C#? I would really appreciate any help as I struggled the last few days and it does not seem like something that should be very difficult to figure out. Thanks! Alex.
|
Fri, 21 Jan 2005 06:49:03 GMT |
|
 |
Mark McIntyr #2 / 11
|
 Question about how to call an .exe file from C#
On 4 Aug 2002 15:49:03 -0700, in comp.lang.c , Quote:
>Hello, >I am really new to programming in general but I have this project >where I need to use C# and I can't figure out something.
Wrong newsgroup. Quote: >The way it works, I need to run an executable file and take a text >file as input. >According to the documentation , from DOS, I would simply have to type >the following: >C:/program_name.exe C:/program_command.txt >This is pretty much the same way in Matlab by the way. >Does anyone know how to do this in C#?
No. If you were asking about C, I'd say system(); -- Mark McIntyre CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html> CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
|
Fri, 21 Jan 2005 06:53:43 GMT |
|
 |
Gordon Burdi #3 / 11
|
 Question about how to call an .exe file from C#
Quote: >I am really new to programming in general but I have this project >where I need to use C# and I can't figure out something. >The way it works, I need to run an executable file and take a text >file as input.
The *ONLY* way in portable ANSI C to run another program is system(). And the strings you pass it are system-dependent. This newsgroup and the above comment apply to C. It may or may not apply to C#, whatever that is, but my guess is that you don't have a license to ask questions about this to anyone but Microsoft (nor does anyone else). Quote: >According to the documentation , from DOS, I would simply have to type >the following: >C:/program_name.exe C:/program_command.txt >This is pretty much the same way in Matlab by the way. >Does anyone know how to do this in C#? >I would really appreciate any help as I struggled the last few days >and it does not seem like something that should be very difficult to >figure out.
Gordon L. Burditt
|
Fri, 21 Jan 2005 09:11:26 GMT |
|
 |
Emmanuel Delahay #4 / 11
|
 Question about how to call an .exe file from C#
Quote: > I am really new to programming in general but I have this project > where I need to use C# and I can't figure out something.
<...> What the heck is C#? This is a C group. Try
(Personnal advice : drop C#, stick to C, C++ and Java) -- -ed- emdel at noos.fr FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/ C-library: http://www.dinkumware.com/htm_cl/index.html "Mal nommer les choses c'est ajouter du malheur au monde." Albert Camus.
|
Fri, 21 Jan 2005 13:26:48 GMT |
|
 |
Robert Stankowi #5 / 11
|
 Question about how to call an .exe file from C#
Quote:
> > I am really new to programming in general but I have this project > > where I need to use C# and I can't figure out something. > <...> > What the heck is C#? This is a C group.
##include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { printf("C# is roughly between %f and %f Hertz\n", 435.0 * pow(2.0, 1.0 / 3.0), 445.0 * pow(2.0, 1.0 / 3.0)); return EXIT_SUCCESS; Quote: }
Robert, supposing there is a "C" answer for more things between heaven and earth than man can imagine :-)
|
Fri, 21 Jan 2005 21:16:32 GMT |
|
 |
Richard Heathfiel #6 / 11
|
 Question about how to call an .exe file from C#
Quote:
> > > I am really new to programming in general but I have this project > > > where I need to use C# and I can't figure out something. > > <...> > > What the heck is C#? This is a C group. > ##include <stdio.h> > #include <stdlib.h> > #include <math.h> > int main(void) > { > printf("C# is roughly between %f and %f Hertz\n", > 435.0 * pow(2.0, 1.0 / 3.0), > 445.0 * pow(2.0, 1.0 / 3.0)); > return EXIT_SUCCESS; > } > Robert, supposing there is a "C" answer for more things between heaven and > earth than man can imagine :-)
I think you're a little sharp. Your estimates (halved to bring them closer to middle C) work out as 274.03282835213491333686830708301 and 280.33243360160927916070436011941 I make C# closer to 271.22255215597958772782727550626 which I derive from 256.0 * pow(2.0, 1.0/12.0) Perhaps we should take this up in rec.music or whatever. :-) --
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999. C FAQ: http://www.eskimo.com/~scs/C-faq/top.html K&R answers, C books, etc: http://users.powernet.co.uk/eton
|
Sat, 22 Jan 2005 03:23:31 GMT |
|
 |
Jens.Toerr.. #7 / 11
|
 Question about how to call an .exe file from C#
Quote:
>> > > I am really new to programming in general but I have this project >> > > where I need to use C# and I can't figure out something. >> > <...> >> > What the heck is C#? This is a C group. >> ##include <stdio.h> >> #include <stdlib.h> >> #include <math.h> >> int main(void) >> { >> printf("C# is roughly between %f and %f Hertz\n", >> 435.0 * pow(2.0, 1.0 / 3.0), >> 445.0 * pow(2.0, 1.0 / 3.0)); >> return EXIT_SUCCESS; >> } >> Robert, supposing there is a "C" answer for more things between heaven and >> earth than man can imagine :-) > I think you're a little sharp. Your estimates (halved to bring them > closer to middle C) work out as > 274.03282835213491333686830708301 > and > 280.33243360160927916070436011941 > I make C# closer to > 271.22255215597958772782727550626 > which I derive from 256.0 * pow(2.0, 1.0/12.0)
In what system kind of system is C# a half-tone above 256 Hz? It looks like you have been dealing with binary numbers for too long ;-) What I would mind about Robert Stankowic's answer is that he assumes that everyone is tuning his instrument to about A = 440 Hz, which a lot people don't do.I for one often use a 415 Hz tuning fork (with C# being 261.433618 Hz) - but when you play with people with a keyboard instrument you have to use what they have anyway ;-) And, of course, these formulas only work when you use this horrible "well-tempered" (as it is nowadays falsely called) system of tuning ... Regards, Jens -- _ _____ _____
_ | | | | | | AG Moebius, Institut fuer Molekuelphysik | |_| | | | | | Fachbereich Physik, Freie Universitaet Berlin \___/ens|_|homs|_|oerring Tel: ++49 (0)30 838 - 53394 / FAX: - 56046
|
Sat, 22 Jan 2005 06:34:51 GMT |
|
 |
Kevin Goodsel #8 / 11
|
 Question about how to call an .exe file from C#
On Mon, 05 Aug 2002 20:23:31 +0100, Richard Heathfield Quote:
>> ##include <stdio.h> >> #include <stdlib.h> >> #include <math.h> >> int main(void) >> { >> printf("C# is roughly between %f and %f Hertz\n", >> 435.0 * pow(2.0, 1.0 / 3.0), >> 445.0 * pow(2.0, 1.0 / 3.0)); >> return EXIT_SUCCESS; >> } >> Robert, supposing there is a "C" answer for more things between heaven and >> earth than man can imagine :-) >I think you're a little sharp. Your estimates (halved to bring them >closer to middle C) work out as > 274.03282835213491333686830708301 >and > 280.33243360160927916070436011941 > I make C# closer to > 271.22255215597958772782727550626 >which I derive from 256.0 * pow(2.0, 1.0/12.0) >Perhaps we should take this up in rec.music or whatever. :-)
The following is utterly OT, and maybe utterly wrong: A above middle C is usually taken to be 440 Hz. To get from one note to the next in the scale, one would multiply the frequency by the 12th root of 2. C# is 4 notes past A, so the frequency would be about 440*pow(pow(2.0, 1.0/12.0), 4) Which is about 554.365 Hz. Of course, this isn't the *only* C#. The one you are looking for is half the frequency (one octave lower), at about 277.183 Hz. -Kevin
|
Sat, 22 Jan 2005 07:57:12 GMT |
|
 |
Emmanuel Delahay #9 / 11
|
 Question about how to call an .exe file from C#
Quote: > The following is utterly OT, and maybe utterly wrong: > A above middle C is usually taken to be 440 Hz. To get from one note
bzzt... middle A (A3) is 440 Hz. -- -ed- emdel at noos.fr FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/ C-library: http://www.dinkumware.com/htm_cl/index.html "Mal nommer les choses c'est ajouter du malheur au monde." Albert Camus.
|
Sat, 22 Jan 2005 08:08:17 GMT |
|
 |
Emmanuel Delahay #10 / 11
|
 Question about how to call an .exe file from C#
Quote: > bzzt... middle A (A3) is 440 Hz.
A4 actually... -- -ed- emdel at noos.fr FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/ C-library: http://www.dinkumware.com/htm_cl/index.html "Mal nommer les choses c'est ajouter du malheur au monde." Albert Camus.
|
Sat, 22 Jan 2005 08:09:19 GMT |
|
 |
Kevin Goodsel #11 / 11
|
 Question about how to call an .exe file from C#
Quote:
>> bzzt... middle A (A3) is 440 Hz. >A4 actually...
I searched for the terms (middle c frequency) on Google and the first two documents returned caught my eye. The first contained this quote: "A440 is the musical note A above middle C." The second contained this quote: "If the piano is properly tuned, middle C has a frequency of 256 cycles per second..." Both of these back up my claim somewhat, but they are inconsistent with each other. The second explains why Mr. Heathfield was using 256 (which a few of us apparently thought strange). I suppose it's safe to say that there is more than one standard for musical pitch. -Kevin
|
Sat, 22 Jan 2005 08:39:52 GMT |
|
|