DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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



Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links