Programming tutorials online .NET, Java, C++, Visual Basic, and More

.NET Tutorials
General Programming Tutorials
Site Extras



Open forum for discussing anything VB 6 or Visual Basic .NET related.

Posted By: totoblj   6/6/2006 10:54:00 PM
i a vb express 2005 programming

i want to write a program to read a file and store contents file in a array.
eg :
i have a coba.txt file : abcdefgh
i want to make array baca_coba,
baca_coba(1) = a
baca_coba(2) = b
baca_coba(3) = c
baca_coba(4) = d
baca_coba(5) = e

i write program :
Dim openFileDialog1 As New OpenFileDialog()

openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
openFileDialog1.FileName = "F:\sementara\coba.txt"
openFileDialog1.FilterIndex = 1
Dim encoding As System.Text.Encoding = System.Text.Encoding.Default
Dim filen As New StreamReader(openFileDialog1.FileName, encoding)
Dim i As Integer
Dim baca_coba(),baca As string
For i = 1 To 10
baca = Int(filen.Read())
baca_coba(i) = chr(baca)

but my program is error, how to make a program to this problem?

if i have a file with unknown unicode. how to write program to know
what type unicode from that file.
eg : from file baca_coba file above, when i click button, a message show with
information: BigEndian unicode

Sign In
  Forgot my password


Featured Book

Introducing Microsoft .Net, Third Edition ($19.79)
Introducing Microsoft .Net, Third Edition

Featured Software

Microsoft Visual Studio Standard 2005 ($249.99)
Microsoft Visual Studio Standard 2005