Building a Console Application in VB for the Alibre Design API - Redirecting the Standard Output E-mail
Article Index
Building a Console Application in VB for the Alibre Design API
Getting Started
Create a Visual Basic Project
Referencing the Alibre Design API
Importing Namespaces
Adding Comments
Setting Up Command Line Flags
Reading the Command Line Arguments
Redirecting the Standard Output
Hooking Alibre Design
Looping Through Sessions
Looping Through Configurations
Finishing Up
Resources
All Pages

Redirecting the Standard Output

The next bit of code will redirect any output that would have normally gone to the screen to a file instead -- but only if we have an output path to use. If an output path or the "-out:" flag wasn't included as a command line argument, then the output will just go to the screen.

    ' Redirect standard out to filestream
    Dim outStream As StreamWriter
    If outPath.Length > 0 Then
      outStream = New StreamWriter(outPath)
      Console.SetOut(outStream)
    End If



Last Updated ( Monday, 28 January 2008 16:22 )