Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# 2010 standard output

C# 2010 standard output

Scheduled Pinned Locked Moved C#
csharptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sc steinhayse
    wrote on last edited by
    #1

    In a C# desktop 2010 application that I need to write, I will be calling a web service. I have been using batch command prompts to save the output to a text file. The commands I have been running in the dos window look like the following: cmd1 > file1. Basically the output shows in a dos window and > makes the data displayed in the dos window go to the standard ouput. My questions are the following: 1. Since I have been using the redirection symbol, the web service must be writing the output to 'standard output' location. However I do not know what the 'standard output' is in a C# 2010 and how to access the 'standard output'. Thus can you tell me what the standard output is and how to access it in a C# 2010 application? 2. Can you tell me how to have information not be displayed in a dos popup window and go to eh location i specify?

    S D 2 Replies Last reply
    0
    • S sc steinhayse

      In a C# desktop 2010 application that I need to write, I will be calling a web service. I have been using batch command prompts to save the output to a text file. The commands I have been running in the dos window look like the following: cmd1 > file1. Basically the output shows in a dos window and > makes the data displayed in the dos window go to the standard ouput. My questions are the following: 1. Since I have been using the redirection symbol, the web service must be writing the output to 'standard output' location. However I do not know what the 'standard output' is in a C# 2010 and how to access the 'standard output'. Thus can you tell me what the standard output is and how to access it in a C# 2010 application? 2. Can you tell me how to have information not be displayed in a dos popup window and go to eh location i specify?

      S Offline
      S Offline
      sjelen
      wrote on last edited by
      #2

      Are you writing a console application? Then Console.Out is your standard output.

      1 Reply Last reply
      0
      • S sc steinhayse

        In a C# desktop 2010 application that I need to write, I will be calling a web service. I have been using batch command prompts to save the output to a text file. The commands I have been running in the dos window look like the following: cmd1 > file1. Basically the output shows in a dos window and > makes the data displayed in the dos window go to the standard ouput. My questions are the following: 1. Since I have been using the redirection symbol, the web service must be writing the output to 'standard output' location. However I do not know what the 'standard output' is in a C# 2010 and how to access the 'standard output'. Thus can you tell me what the standard output is and how to access it in a C# 2010 application? 2. Can you tell me how to have information not be displayed in a dos popup window and go to eh location i specify?

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        sc steinhayse wrote:

        the web service must be writing the output to 'standard output'

        Wrong. The web service has no access to the client streams at all. It's your "cmd1" executable that is writing the data to standard output, not the web service.

        sc steinhayse wrote:

        2. Can you tell me how to have information not be displayed in a dos popup window and go to eh location i specify?

        That depends on your "cmd1" code. All you need to do is grab a path specified on the command line, open the file specified by the path, and write the data to that instead of outputting it to the console. An example of your command line would be:

        cmd1 C:\\somepath\\somefile.txt
        

        If you don't know how to get command line parameters or open a file and write to it, you've got some research to do on the basics of C# and the .NET Framework. Such as this[^] and this[^]

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        S 1 Reply Last reply
        0
        • D Dave Kreskowiak

          sc steinhayse wrote:

          the web service must be writing the output to 'standard output'

          Wrong. The web service has no access to the client streams at all. It's your "cmd1" executable that is writing the data to standard output, not the web service.

          sc steinhayse wrote:

          2. Can you tell me how to have information not be displayed in a dos popup window and go to eh location i specify?

          That depends on your "cmd1" code. All you need to do is grab a path specified on the command line, open the file specified by the path, and write the data to that instead of outputting it to the console. An example of your command line would be:

          cmd1 C:\\somepath\\somefile.txt
          

          If you don't know how to get command line parameters or open a file and write to it, you've got some research to do on the basics of C# and the .NET Framework. Such as this[^] and this[^]

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          S Offline
          S Offline
          sc steinhayse
          wrote on last edited by
          #4

          I do not know how to make the C# application use the command line arguments I pass to it. My command line looks like the following:

          Start .\samclt\bin\Debug\samcl.exe encrypted_value https://test/test/testWebService 1 ITEM

          I know the application is not using the parameters that appear after the exe by stepping though the code. Thus can can you tell me how to make the application see the parameters I am trying to pass to it?

          D 1 Reply Last reply
          0
          • S sc steinhayse

            I do not know how to make the C# application use the command line arguments I pass to it. My command line looks like the following:

            Start .\samclt\bin\Debug\samcl.exe encrypted_value https://test/test/testWebService 1 ITEM

            I know the application is not using the parameters that appear after the exe by stepping though the code. Thus can can you tell me how to make the application see the parameters I am trying to pass to it?

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            I already showed you in the links at the bottom of my previous post.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups