I want to return a value (a string) from my C# program to cmd. How can I do this?
Asked
Active
Viewed 975 times
1
-
1Uh, what type of project? Console, WinForms, WPF, etc. – Tieson T. Jun 04 '12 at 01:48
-
2I assume you tried `Console.WriteLine()`? – Ilia G Jun 04 '12 at 01:48
-
do you mean like this: http://www.codeproject.com/Articles/4582/Command-Line-Written-in-C – Jeremy Thompson Jun 04 '12 at 01:50
-
@IliaG I tried your suggestion earlier, but it didn't work but now it works. Thank you. – Teysz Jun 04 '12 at 01:57
-
can you explain a bit more on how it should work? – Ray Cheng Jun 04 '12 at 01:57
-
If you mean accessing CMD from c#, then start voting for opening the question again ! – Ahmed Ghoneim Jun 04 '12 at 02:01
-
1This is definitely not a duplicate of the question that was originally marked as such. However, it would be useful to include more information on what you have tried here. A quick note: It's not possible to 'return' a string value, but you can write anything you want to the console, which you can capture and direct as needed. – Andrew Barber Mar 18 '13 at 14:57