Results 1 to 3 of 3

Thread: Catching CMD Pipes? [ RESOLVED ]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    23

    Resolved Catching CMD Pipes? [ RESOLVED ]

    Hey, Im working on a speech program that takes a defined file and reads it. But im trying to keep it from being hardcoded, Ive got it to work with Command Line Args, but Im wanting to create a batch file where I define the file to be read from there. Ive got the CMD line need

    type C:\test.txt|Speech.exe

    but I cant find a way to have my program open up and recieve the Standard IO. Anyone have any tips?
    Last edited by DustinH; May 24th, 2005 at 05:22 PM.

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Catching CMD Pipes?

    Play a bit with:
    VB Code:
    1. Dim str As System.IO.StreamReader = New System.IO.StreamReader(Console.OpenStandardInput())
    2. Debug.WriteLine(str.ReadToEnd())
    You don't need to explicitly open the stream.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    23

    Re: Catching CMD Pipes?

    Alrighty, that helped alot man! Finally Got it, Thanks a million!
    Here's the code I ended up with just incase someone else hits this problem.

    VB Code:
    1. Dim str As System.IO.StreamReader = New System.IO.StreamReader(Console.OpenStandardInput())
    2.         Console.Write(strSpeak)
    3.         strSpeak = str.ReadToEnd()
    4.         txtSpeak.Text = strSpeak
    5.  
    6.         Dim Voice As SpeechLib.SpVoice
    7.         Voice = New SpeechLib.SpVoice
    8.         Voice.Speak(strSpeak, SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync)

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