been trying to do this for a few days with not much luck, I found some code when I searched but its not reading 900 chars of the file only the first few characters, heres my code:
BTW its supposed to read the first 900 chars
VB Code:
Dim File As String Dim fs As FileStream Dim binRead As BinaryReader Dim readbuf(900) As Char Dim i As Integer Dim strData As String = vbNullString File = "C:\UK Wholesalers.doc" fs = New FileStream(File, FileMode.Open, FileAccess.Read, FileShare.None) binRead = New BinaryReader(fs) readbuf = binRead.ReadChars(900) binRead.Close() 'convert the char array to string For i = 0 To readbuf.GetUpperBound(0) strData = strData & readbuf(i) Next TextBox1.Text = strData
anyone got any ideas?![]()




Reply With Quote