Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: Timeout expired Pin
Luc Pattyn12-Oct-09 0:15
sitebuilderLuc Pattyn12-Oct-09 0:15 
AnswerRe: Timeout expired Pin
Dave Kreskowiak12-Oct-09 8:25
mveDave Kreskowiak12-Oct-09 8:25 
QuestionChanging Folder Permission using C# Pin
MikeSharp11-Oct-09 18:21
MikeSharp11-Oct-09 18:21 
QuestionList of classes as a property of a class Pin
Protus11-Oct-09 16:06
Protus11-Oct-09 16:06 
AnswerRe: List of classes as a property of a class Pin
N a v a n e e t h11-Oct-09 17:00
N a v a n e e t h11-Oct-09 17:00 
QuestionStreamReader -> StreamWriter... file comes out much bigger !! Pin
je198011-Oct-09 8:56
je198011-Oct-09 8:56 
AnswerRe: StreamReader -> StreamWriter... file comes out much bigger !! Pin
harold aptroot11-Oct-09 8:59
harold aptroot11-Oct-09 8:59 
AnswerRe: StreamReader -> StreamWriter... file comes out much bigger !! [modified] Pin
Jaime Olivares11-Oct-09 18:47
Jaime Olivares11-Oct-09 18:47 
Better you copy the stream in chunks:

StreamWriter writer = new StreamWriter (existingFilePath);
StreamReader reader = new StreamReader(copiedFilePath);

byte[] buffer = new byte[32768];    
while (true)    {        
     int read = reader.Read (buffer, 0, buffer.Length);\
     if (read <= 0)            
          break;   // <--- EDITED: IT WAS return
     writer.Write (buffer, 0, read);    
}

writer .Close();
reader.Close();


Best regards,
Jaime.

modified on Monday, October 12, 2009 12:41 PM

GeneralRe: StreamReader -&gt; StreamWriter... file comes out much bigger !! Pin
riced12-Oct-09 6:13
riced12-Oct-09 6:13 
GeneralRe: StreamReader -&gt; StreamWriter... file comes out much bigger !! Pin
Jaime Olivares12-Oct-09 6:40
Jaime Olivares12-Oct-09 6:40 
GeneralRe: StreamReader -&gt; StreamWriter... file comes out much bigger !! Pin
riced12-Oct-09 6:56
riced12-Oct-09 6:56 
GeneralRe: StreamReader -&gt; StreamWriter... file comes out much bigger !! Pin
Jaime Olivares12-Oct-09 7:39
Jaime Olivares12-Oct-09 7:39 
Questionextract files with the filestream Pin
nhqlbaislwfiikqraqnm11-Oct-09 8:15
nhqlbaislwfiikqraqnm11-Oct-09 8:15 
AnswerRe: extract files with the filestream Pin
Christian Graus11-Oct-09 10:27
protectorChristian Graus11-Oct-09 10:27 
Questiondll loading? Pin
nhqlbaislwfiikqraqnm1-Apr-21 23:29
nhqlbaislwfiikqraqnm1-Apr-21 23:29 
AnswerRe: dll loading? Pin
Richard MacCutchan11-Oct-09 8:45
mveRichard MacCutchan11-Oct-09 8:45 
GeneralRe: dll loading? Pin
Not Active11-Oct-09 8:53
mentorNot Active11-Oct-09 8:53 
GeneralRe: dll loading? Pin
Richard MacCutchan11-Oct-09 9:29
mveRichard MacCutchan11-Oct-09 9:29 
AnswerRe: dll loading? Pin
Not Active11-Oct-09 8:48
mentorNot Active11-Oct-09 8:48 
AnswerRe: dll loading? Pin
Nissim Salomon11-Oct-09 9:36
Nissim Salomon11-Oct-09 9:36 
AnswerRe: dll loading? Pin
Christian Graus11-Oct-09 10:28
protectorChristian Graus11-Oct-09 10:28 
AnswerRe: dll loading? Pin
freakyit11-Oct-09 22:22
freakyit11-Oct-09 22:22 
QuestionData Structure Pin
phobberman11-Oct-09 8:05
phobberman11-Oct-09 8:05 
AnswerRe: Data Structure Pin
riced12-Oct-09 6:21
riced12-Oct-09 6:21 
GeneralRe: Data Structure Pin
phobberman13-Oct-09 0:01
phobberman13-Oct-09 0:01 

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.