Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I would like to display a file in a textbox or RichTextbox. I how load the file but the file is encoded in UTF8 format. and some characters do not show. Like chr(0) chr(1) chr(3). Things that are not really displayed. Is there away to display these characters? I know it would be more of a "place holder" but that is what I would like.

 

Thanks

 

ZeroEffect

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Posted
Ok I have found that null chr(0) cannot be displayed and when loading the file it stops at a null character. Any thoughts?

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Posted

Thanks for the reply, this is how I am doing it.

 

       tbreadfromfile.Clear()
       Dim sr As New StreamReader(TextBox1.Text & ".dat", Encoding.UTF8)
       Dim data As Object = sr.ReadToEnd
       tbreadfromfile.Text = data
       sr.Close()

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Posted

I'll make that change. I am makeing the file too.

 

       Dim sw As New System.IO.StreamWriter(TextBox1.Text & ".dat", False, Encoding.UTF8)

       Dim k As Integer = 4
       For i As Integer = 0 To holder.Length - 1
           If i = k Then
               k = k + 5
               sw.Write(Chr(0))
               sw.Write(Chr(1))
               sw.Write(Chr(2))
           Else

           End If
           sw.Write(Hex(Asc(holder.Substring(i, 1))))
           tbFinalOutput.AppendText(Hex(Asc(holder.Substring(i, 1))))

       Next
       sw.Write(Chr(0))
       sw.Close()

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...