Need Help with Output to Text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Todd Shillam

    Need Help with Output to Text

    Here's my script--need help with output to text file (must be missing
    something here like closing the file or something). Any help would be
    greatly appreciated here. Lastly, I'm using Visual Basic .NET 2003.
    Source...

    Dim vFileName As String
    vFileName = Format(Now(), "MM - dd - yyyy") & " - " & vName
    Dim oFile As System.IO.File
    Dim oWrite As System.IO.Strea mWriter
    oWrite = oFile.CreateTex t("C:\" & vFileName & ".txt")

    FileOpen(1, "C:\" & vFileName & ".txt", OpenMode.Output ) 'CAN'T GET TEXT TO
    WRITE TO FILE
    oWrite.WriteLin e("Debugging Code is Fun")
    oWrite.WriteLin e("And Pigs Fly")


    Todd


  • Randy Birch

    #2
    Re: Need Help with Output to Text


    This group is really for VB6 and earlier. I recommend you take a look at the
    groups devoted exclusively to .net programming on the microsoft news server,
    named such as:

    news://msnews.microsoft.com/microsof...dotnet.general
    news://msnews.microsoft.com/microsof...t.languages.vb
    news://msnews.microsoft.com/microsof....vsnet.general
    news://msnews.microsoft.com/microsof...studio.general
    news://msnews.microsoft.com/microsof....vstudio.setup

    .... etc.

    --


    Randy Birch
    MS MVP Visual Basic



    "Todd Shillam" <tshillam(@)hot mail.com> wrote in message
    news:TIKdnecSma uT_2HcRVn-tA@comcast.com. ..
    : Here's my script--need help with output to text file (must be missing
    : something here like closing the file or something). Any help would be
    : greatly appreciated here. Lastly, I'm using Visual Basic .NET 2003.
    : Source...
    :
    : Dim vFileName As String
    : vFileName = Format(Now(), "MM - dd - yyyy") & " - " & vName
    : Dim oFile As System.IO.File
    : Dim oWrite As System.IO.Strea mWriter
    : oWrite = oFile.CreateTex t("C:\" & vFileName & ".txt")
    :
    : FileOpen(1, "C:\" & vFileName & ".txt", OpenMode.Output ) 'CAN'T GET TEXT
    TO
    : WRITE TO FILE
    : oWrite.WriteLin e("Debugging Code is Fun")
    : oWrite.WriteLin e("And Pigs Fly")
    :
    :
    : Todd
    :
    :

    Comment

    • Todd Shillam

      #3
      Re: Need Help with Output to Text

      Randy,

      I got it; however, thanks for the references--I'll be sure to check them
      out.

      Best regards,

      Todd

      "Randy Birch" <rgb_removethis @mvps.org> wrote in message
      news:EP6dnSmoLK TU-GHcRVn-sQ@rogers.com.. .[color=blue]
      >
      > This group is really for VB6 and earlier. I recommend you take a look at
      > the
      > groups devoted exclusively to .net programming on the microsoft news
      > server,
      > named such as:
      >
      > news://msnews.microsoft.com/microsof...dotnet.general
      > news://msnews.microsoft.com/microsof...t.languages.vb
      > news://msnews.microsoft.com/microsof....vsnet.general
      > news://msnews.microsoft.com/microsof...studio.general
      > news://msnews.microsoft.com/microsof....vstudio.setup
      >
      > ... etc.
      >
      > --
      >
      >
      > Randy Birch
      > MS MVP Visual Basic
      > http://vbnet.mvps.org/
      >
      >
      > "Todd Shillam" <tshillam(@)hot mail.com> wrote in message
      > news:TIKdnecSma uT_2HcRVn-tA@comcast.com. ..
      > : Here's my script--need help with output to text file (must be missing
      > : something here like closing the file or something). Any help would be
      > : greatly appreciated here. Lastly, I'm using Visual Basic .NET 2003.
      > : Source...
      > :
      > : Dim vFileName As String
      > : vFileName = Format(Now(), "MM - dd - yyyy") & " - " & vName
      > : Dim oFile As System.IO.File
      > : Dim oWrite As System.IO.Strea mWriter
      > : oWrite = oFile.CreateTex t("C:\" & vFileName & ".txt")
      > :
      > : FileOpen(1, "C:\" & vFileName & ".txt", OpenMode.Output ) 'CAN'T GET TEXT
      > TO
      > : WRITE TO FILE
      > : oWrite.WriteLin e("Debugging Code is Fun")
      > : oWrite.WriteLin e("And Pigs Fly")
      > :
      > :
      > : Todd
      > :
      > :
      >[/color]


      Comment

      Working...