473,513 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textfile & Arrays

1 New Member
Can you help me how to use textfile step by step process and showing how to use the object?
removed mail id
We have no enough to to do our program csn you please teah us?
removed mail id
Jan 11 '08 #1
1 905
jamesd0142
469 Contributor
you will need to add this above the class declaration:
Expand|Select|Wrap|Line Numbers
  1. imports system.io
  2.  
Then edit the following functions to you needs:
Expand|Select|Wrap|Line Numbers
  1. Private Sub createTextFile()
  2.         Dim oTxtWriter As New StreamWriter(path1)
  3.         oTxtWriter.WriteLine("This is a line")
  4.         oTxtWriter.Flush()
  5.         oTxtWriter.Close()
  6.     End Sub
  7.  
  8.     Private Sub WriteFile()
  9.         'can use .append instead of .output
  10.         Dim Date1 As String = Format$(Now)
  11.         Dim Date2 As String = Mid(Date1, 1, 10)
  12.         FileOpen(1, "C:\text123412.txt", OpenMode.Output)
  13.         Print(1, Date2) ', Environment.NewLine)
  14.         FileClose(1)
  15.     End Sub
  16.  
  17.     Function Readfile(ByVal abc)
  18.         Dim EntireLine As String
  19.         Dim oFile As System.IO.File
  20.         Dim oRead As System.IO.StreamReader
  21.         oRead = oFile.OpenText("C:\text123412.txt")
  22.         EntireLine = oRead.ReadToEnd
  23.         oRead.Close() 'test line
  24.         Return EntireLine
  25.     End Function
  26.  
There are much better ways to do this but they work so i use them.

Thanks James
Jan 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
4992
by: Hans A | last post by:
I have a textfile "textfile.txt" containing a list of words. There is one word on each line. I want to pick two random lines from this textfile, and I have tried to do something like: //Loading...
5
3940
by: jab3 | last post by:
(again :)) Hello everyone. I'll ask this even at risk of being accused of not researching adequately. My question (before longer reasoning) is: How does declaring (or defining, whatever) a...
8
3152
by: scythetleppo | last post by:
I am new thanks for the help. I have a text file set up like this: word1a<tab>word2a<tab>word3a<tab>word4a word1b<tab>word2b<tab>word3b<tab>word4b word1c<tab>word2c<tab>word3c<tab>word4c I...
1
2803
by: asedt | last post by:
With my Excel macro and two text files I want to create a new textfile containing the first textfile then text from the sheet and then the second textfile. My problem is that i don't know how to...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5689
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5094
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3236
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.