Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralRe: res://ieframe.dll/navcancl.htm#http://localhost:2441/ErrorPage.aspx?ErrorId= Pin
Pete O'Hanlon8-Aug-12 23:31
mvePete O'Hanlon8-Aug-12 23:31 
GeneralConvert Word Doc to Byte Pin
ASPnoob8-Aug-12 19:46
ASPnoob8-Aug-12 19:46 
GeneralRe: Convert Word Doc to Byte Pin
Pete O'Hanlon8-Aug-12 20:16
mvePete O'Hanlon8-Aug-12 20:16 
GeneralRe: Convert Word Doc to Byte Pin
ASPnoob8-Aug-12 21:18
ASPnoob8-Aug-12 21:18 
GeneralRe: Convert Word Doc to Byte Pin
Pete O'Hanlon8-Aug-12 22:40
mvePete O'Hanlon8-Aug-12 22:40 
GeneralRe: Convert Word Doc to Byte Pin
ASPnoob9-Aug-12 0:45
ASPnoob9-Aug-12 0:45 
GeneralRe: Convert Word Doc to Byte Pin
Pete O'Hanlon9-Aug-12 0:52
mvePete O'Hanlon9-Aug-12 0:52 
GeneralRe: Convert Word Doc to Byte Pin
lmoelleb9-Aug-12 5:27
lmoelleb9-Aug-12 5:27 
It is a common misunderstanding that the Stream.Read method will read the number of bytes you specify in the count argument. But the count parameter specify the maximum number of bytes the stream is allowed to read. An implementation of a stream is free to return fewer bytes, even if it has not reached the end of the stream. It must return at least one byte unless the end of stream has been reached.

The MemoryStream implementation happens to read all at once - and it is probably unlikely to change any time soon but I would not recommend to get used to this behavior - because then you start using it with other stream types you will get errors.

The easy solution here is to use MemoryStream.ToArray(). In other cases where you need to read a fixed number of bytes from a stream you will either have to make a loop calling Read again if it did not return all bytes or you can for example create a BinaryReader for the stream.
GeneralRe: Convert Word Doc to Byte Pin
Pete O'Hanlon9-Aug-12 5:36
mvePete O'Hanlon9-Aug-12 5:36 
Questionimage recognition through google image search Pin
Mohsin Mushtaq8-Aug-12 4:03
Mohsin Mushtaq8-Aug-12 4:03 
AnswerRe: image recognition through google image search Pin
Shameel8-Aug-12 4:19
professionalShameel8-Aug-12 4:19 
GeneralRe: image recognition through google image search Pin
Mohsin Mushtaq8-Aug-12 4:30
Mohsin Mushtaq8-Aug-12 4:30 
GeneralRe: image recognition through google image search Pin
lewax008-Aug-12 5:11
lewax008-Aug-12 5:11 
GeneralRe: image recognition through google image search Pin
Mohsin Mushtaq9-Aug-12 9:15
Mohsin Mushtaq9-Aug-12 9:15 
QuestionHow to enable gestures in windows 8 touch ultrabook Pin
ashishguptajhansi8-Aug-12 2:28
ashishguptajhansi8-Aug-12 2:28 
AnswerRe: How to enable gestures in windows 8 touch ultrabook Pin
Richard MacCutchan8-Aug-12 4:05
mveRichard MacCutchan8-Aug-12 4:05 
AnswerRe: How to enable gestures in windows 8 touch ultrabook Pin
BillWoodruff9-Aug-12 8:09
professionalBillWoodruff9-Aug-12 8:09 
QuestionNeed to improve oops concepts Pin
Alagiri.periyasamy@merrillcorp.com8-Aug-12 1:10
Alagiri.periyasamy@merrillcorp.com8-Aug-12 1:10 
AnswerRe: Need to improve oops concepts Pin
Pete O'Hanlon8-Aug-12 1:22
mvePete O'Hanlon8-Aug-12 1:22 
AnswerRe: Need to improve oops concepts Pin
Alan Balkany8-Aug-12 4:31
Alan Balkany8-Aug-12 4:31 
AnswerRe: Need to improve oops concepts Pin
wizardzz8-Aug-12 5:29
wizardzz8-Aug-12 5:29 
QuestionList all the open ports Pin
sarang_k7-Aug-12 20:41
sarang_k7-Aug-12 20:41 
AnswerRe: List all the open ports Pin
Wayne Gaylard7-Aug-12 20:49
professionalWayne Gaylard7-Aug-12 20:49 
GeneralRe: List all the open ports Pin
Pete O'Hanlon8-Aug-12 1:36
mvePete O'Hanlon8-Aug-12 1:36 
GeneralRe: List all the open ports Pin
Wayne Gaylard8-Aug-12 3:33
professionalWayne Gaylard8-Aug-12 3:33 

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.