CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Process in C#

  1. #1
    Join Date
    Mar 2007
    Posts
    116

    Lightbulb Process in C#

    Hi,

    I am creating a Process in C# and want to print my "strName" value to command prompt.
    This code is not printing any value , please let me know the right code.
    I know this code is wrong,,but if we pass Arguments then?
    string strName = "Alex";
    Process pr = new Process();
    pr.StartInfo.FileName = "cmd.exe";
    pr.Start();

    Thanks
    Last edited by Frank100; April 9th, 2010 at 09:19 AM.

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Process in C#

    And why would you expect that to print anything to the console exactly? You start cmd.exe with no parameters and simply declare a string variable in your code. If you wish to print to the Console, print to stdout and redirect it to the console if necessary.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured