Solved

Using VB I want to create a new text file and write a line of text.

Posted on 2011-03-11
2
319 Views
Last Modified: 2012-05-11
Using VB I want to create a new text file and write a line of text.

I am going through the article:
http://www.techrepublic.com/article/read-and-write-text-files-with-visual-basic-net/1045309

I have managed to create a new text file.

I now want to write a line to the text file.

When I execute my WRITE code I get an error.

I think this because of create method is still holding on to the file.

How do I release the file to allow me to write to it?
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 35107755
Can you show what you have so far ...

Easiest example to create a file and write to it

   
Dim TextFile As New StreamWriter("test.txt")
    TextFile.WriteLine("Line 1")
    TextFile.WriteLine("Line 2")
    TextFile.Close()

Open in new window

0
 

Author Closing Comment

by:Mr_Shaw
ID: 35107829
Your code did the trick...

thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

634 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question