Click here to Skip to main content
15,927,345 members
Home / Discussions / C#
   

C#

 
GeneralRe: MaskedTextBox help Pin
nhqlbaislwfiikqraqnm15-Aug-09 23:57
nhqlbaislwfiikqraqnm15-Aug-09 23:57 
GeneralRe: MaskedTextBox help Pin
Hristo-Bojilov16-Aug-09 2:00
Hristo-Bojilov16-Aug-09 2:00 
QuestionAnnotations on screen Pin
Vijay Mudunuri15-Aug-09 22:54
Vijay Mudunuri15-Aug-09 22:54 
Questionstatic data members and methods Pin
Black Gen15-Aug-09 21:28
Black Gen15-Aug-09 21:28 
AnswerRe: static data members and methods Pin
OriginalGriff15-Aug-09 22:03
mveOriginalGriff15-Aug-09 22:03 
AnswerRe: static data members and methods Pin
Saksida Bojan15-Aug-09 22:09
Saksida Bojan15-Aug-09 22:09 
Questionadding PNG icons with tranparency to listview Pin
Muhammad Ahmed15-Aug-09 16:22
Muhammad Ahmed15-Aug-09 16:22 
AnswerRe: adding PNG icons with tranparency to listview Pin
Henry Minute16-Aug-09 3:19
Henry Minute16-Aug-09 3:19 
QuestionFileStream runtime issues (Updated) [modified] Pin
Mikey_H15-Aug-09 14:21
Mikey_H15-Aug-09 14:21 
AnswerRe: FileStream runtime issues Pin
Luc Pattyn15-Aug-09 14:38
sitebuilderLuc Pattyn15-Aug-09 14:38 
GeneralRe: FileStream runtime issues [modified] Pin
Mikey_H15-Aug-09 14:59
Mikey_H15-Aug-09 14:59 
AnswerRe: FileStream runtime issues Pin
riced15-Aug-09 23:09
riced15-Aug-09 23:09 
GeneralRe: FileStream runtime issues Pin
Mikey_H15-Aug-09 23:22
Mikey_H15-Aug-09 23:22 
AnswerRe: FileStream runtime issues (Updated) Pin
riced16-Aug-09 0:18
riced16-Aug-09 0:18 
GeneralRe: FileStream runtime issues (Updated) Pin
Mikey_H16-Aug-09 1:44
Mikey_H16-Aug-09 1:44 
GeneralRe: FileStream runtime issues (Updated) Pin
riced16-Aug-09 2:32
riced16-Aug-09 2:32 
I can't reproduce this problem so don't know how to solve it.
There is the possibility that it is just a MessageBox issue.

I created a form as I said before with button and multiline textbox then added this code as click handler.
private void button1_Click(object sender, EventArgs e)
{
   //FileInfo m_FileInfo = new FileInfo("C:\\Playpen\\poker_utf8.txt");
   FileInfo m_FileInfo = new FileInfo("C:\\Playpen\\poker.txt");
   long fileLen = m_FileInfo.Length;
   byte[] buffer = new byte[fileLen];

   using (FileStream stream = new FileStream(m_FileInfo.FullName, FileMode.Open, FileAccess.Read))
   {
      // Read data from file to the buffer
      for (long i = 0; i != fileLen; i++)
         buffer[i] = (byte)stream.ReadByte();
   }

   string data = new System.Text.UTF8Encoding(true).GetString(buffer);
   long strLen = data.Length;
   MessageBox.Show("Len of buffer: " + fileLen.ToString() + "\r\nLen of data  : " + strLen.ToString());
   textBox1.Text = data;
   MessageBox.Show(data); // Shows incomplete file
}


Set a breakpoint on 'string data = ...' and then step through it.
The data string does contain whole of file. And this is confirmed by the textbox contents.
I created poker.txt by copying your text and doing multiple pastes using Notepad. poker_utf8.txt is the same file saved as UTF-8.
(You get a slight discrepancy in lengths when using poker_utf8 because the UTF-8 has a three byte BOM as a prefix.)

Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis

GeneralRe: FileStream runtime issues (Updated) Pin
Mikey_H16-Aug-09 12:48
Mikey_H16-Aug-09 12:48 
QuestionReading letters from an Image in C# Pin
Sumit_Ghosh15-Aug-09 12:41
Sumit_Ghosh15-Aug-09 12:41 
AnswerRe: Reading letters from an Image in C# Pin
Henry Minute15-Aug-09 13:24
Henry Minute15-Aug-09 13:24 
QuestionWeb Browser(C# + other .NET technologies) Pin
abhifanatic15-Aug-09 10:12
abhifanatic15-Aug-09 10:12 
AnswerRe: Web Browser(C# + other .NET technologies) Pin
Saksida Bojan15-Aug-09 10:29
Saksida Bojan15-Aug-09 10:29 
QuestionC# IP Scanner Pin
nhqlbaislwfiikqraqnm15-Aug-09 10:06
nhqlbaislwfiikqraqnm15-Aug-09 10:06 
AnswerRe: C# IP Scanner Pin
Saksida Bojan15-Aug-09 10:31
Saksida Bojan15-Aug-09 10:31 
GeneralRe: C# IP Scanner Pin
nhqlbaislwfiikqraqnm15-Aug-09 10:52
nhqlbaislwfiikqraqnm15-Aug-09 10:52 
GeneralRe: C# IP Scanner Pin
Saksida Bojan15-Aug-09 18:57
Saksida Bojan15-Aug-09 18:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.