Click here to Skip to main content
15,889,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to get Windows Country List (Location List) seen in the Control Panel Pin
Eddy Vluggen15-Jun-11 9:06
professionalEddy Vluggen15-Jun-11 9:06 
GeneralRe: How to get Windows Country List (Location List) seen in the Control Panel Pin
Pete O'Hanlon14-Jun-11 3:34
mvePete O'Hanlon14-Jun-11 3:34 
AnswerRe: How to get Windows Country List (Location List) seen in the Control Panel Pin
jschell14-Jun-11 8:22
jschell14-Jun-11 8:22 
GeneralRe: How to get Windows Country List (Location List) seen in the Control Panel Pin
MrSmoofy14-Jun-11 9:16
MrSmoofy14-Jun-11 9:16 
AnswerRe: How to get Windows Country List (Location List) seen in the Control Panel Pin
Roger Wright14-Jun-11 20:01
professionalRoger Wright14-Jun-11 20:01 
QuestionHow to avoid Stream.Read() block when internet connection is suddenly down? Pin
Chesnokov Yuriy13-Jun-11 4:49
professionalChesnokov Yuriy13-Jun-11 4:49 
AnswerRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
BobJanova13-Jun-11 6:06
BobJanova13-Jun-11 6:06 
AnswerRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
Luc Pattyn13-Jun-11 7:26
sitebuilderLuc Pattyn13-Jun-11 7:26 
As Bob already said, Read() is blocking.

As the operation can be long-winding due to the amount of data, the lack of speed of the connection, or the potential failure of the transmission, you should be doing this on a background thread, allowing your app to continue its normal operation (at the bare minimum take care of the GUI), and possibly also allowing you to give up and maybe retry.

BTW: I don't think every data source has to know and provide a ContentLength beforehand, so your approach with a pre-allocated byte array may fail for some sources. The alternative is to capture the data in a more dynamic structure (e.g. a list of arrays, each array holding one Read result) and then rearrange it if necessary. You could use this scheme when ContentLength returns abnormal values, such as zero.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Please use <PRE> tags for code snippets, they improve readability.
CP Vanity has been updated to V2.4

GeneralRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
Chesnokov Yuriy13-Jun-11 7:57
professionalChesnokov Yuriy13-Jun-11 7:57 
AnswerRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
Luc Pattyn13-Jun-11 10:41
sitebuilderLuc Pattyn13-Jun-11 10:41 
AnswerRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
Chesnokov Yuriy13-Jun-11 20:24
professionalChesnokov Yuriy13-Jun-11 20:24 
AnswerRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
jschell13-Jun-11 8:39
jschell13-Jun-11 8:39 
AnswerRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
Chesnokov Yuriy13-Jun-11 9:06
professionalChesnokov Yuriy13-Jun-11 9:06 
QuestionAdd the RegularExpressionValidator on the server side Pin
vanikanc13-Jun-11 4:45
vanikanc13-Jun-11 4:45 
AnswerRe: Add the RegularExpressionValidator on the server side Pin
Not Active13-Jun-11 6:54
mentorNot Active13-Jun-11 6:54 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
vanikanc13-Jun-11 7:04
vanikanc13-Jun-11 7:04 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
Not Active13-Jun-11 7:46
mentorNot Active13-Jun-11 7:46 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
vanikanc13-Jun-11 7:48
vanikanc13-Jun-11 7:48 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
Not Active13-Jun-11 8:37
mentorNot Active13-Jun-11 8:37 
QuestionBasic Insert Row Question Pin
AmbiguousName13-Jun-11 1:46
AmbiguousName13-Jun-11 1:46 
AnswerRe: Basic Insert Row Question Pin
Pete O'Hanlon13-Jun-11 2:07
mvePete O'Hanlon13-Jun-11 2:07 
GeneralRe: Basic Insert Row Question Pin
AmbiguousName13-Jun-11 2:30
AmbiguousName13-Jun-11 2:30 
GeneralRe: Basic Insert Row Question Pin
Pete O'Hanlon13-Jun-11 2:51
mvePete O'Hanlon13-Jun-11 2:51 
AnswerRe: Basic Insert Row Question Pin
phil.o13-Jun-11 2:16
professionalphil.o13-Jun-11 2:16 
GeneralRe: Basic Insert Row Question Pin
AmbiguousName13-Jun-11 2:29
AmbiguousName13-Jun-11 2:29 

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.