Write to file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Write to file

  1. #1
    Corne Guest

    Write to file


    Hi ,
    can anyone tell me how I can write information like username and status to
    a text file using VB?

  2. #2
    Matt Markus Guest

    Re: Write to file

    Hi Corne (ha) -

    "Corne" <scheepersc@logica.com> wrote in message
    news:3c6bc3b3$1@10.1.10.29...
    >
    > Hi ,
    > can anyone tell me how I can write information like username and status to
    > a text file using VB?



    Dim sUserName As String
    Dim sStatus As String

    sUserName = "jsmith"
    sStatus = "pending"

    Open "c:\log.txt" For Output As #1
    Print #1, "UserName = " & sUserName & vbCrLf & "Status = " & sStatus
    Close #1




  3. #3
    Paul Guest

    Re: Write to file


    "Corne" <scheepersc@logica.com> wrote:
    >
    >Hi ,
    >can anyone tell me how I can write information like username and status

    to
    >a text file using VB?


    You must first open the file with an open statement.
    Write your data to the file.
    Close the file

    ff=freefile
    Open "c:\myfile" for output As #ff
    Write #ff, data (you can also use Print)
    Close #ff



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center