Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: dynamically creating & modfying XML file using C# Pin
David Stone17-Jan-03 4:37
sitebuilderDavid Stone17-Jan-03 4:37 
GeneralProcess Filename Pin
CyberKewl16-Jan-03 21:59
CyberKewl16-Jan-03 21:59 
GeneralRe: Process Filename Pin
Nnamdi Onyeyiri19-Jan-03 2:58
Nnamdi Onyeyiri19-Jan-03 2:58 
GeneralRe: Process Filename Pin
CyberKewl19-Jan-03 3:49
CyberKewl19-Jan-03 3:49 
GeneralRe: Process Filename Pin
Nnamdi Onyeyiri19-Jan-03 3:50
Nnamdi Onyeyiri19-Jan-03 3:50 
GeneralSockets && Detecting FileSent Completion Pin
gekoscan16-Jan-03 12:52
gekoscan16-Jan-03 12:52 
GeneralRe: Sockets && Detecting FileSent Completion Pin
David Stone16-Jan-03 13:03
sitebuilderDavid Stone16-Jan-03 13:03 
GeneralRe: Sockets && Detecting FileSent Completion Pin
Nick Parker17-Jan-03 17:31
protectorNick Parker17-Jan-03 17:31 
LostInACave wrote:
There must be an easier way...

I think you could implement this type of idea..... this is not tested, just the deal.
FileStream fs = new FileStream("Test.txt", FileMode.Open);
long BytesRemaining = fs.Length();
while(BytesRemaining)
{
    //read from file into buff....
    fs.Read(buff, offset, count);
    //send buff here...
    ///...
    //this will not work you need to get this size of the buff
    long BytesRead = buff.Length() 
    //decrement your count                        
    BytesRemaining -= BytesRead;
}


This way your while loop will exit only when you have transfered all the data.



Nick Parker

You see the Standards change. - Fellow co-worker


GeneralTelnet Pin
David Stone16-Jan-03 11:44
sitebuilderDavid Stone16-Jan-03 11:44 
GeneralRe: Telnet Pin
Nnamdi Onyeyiri19-Jan-03 2:53
Nnamdi Onyeyiri19-Jan-03 2:53 
AnswerRe: Fullscreen forms? Pin
p daddy16-Jan-03 6:18
p daddy16-Jan-03 6:18 
GeneralRe: Fullscreen forms? Pin
Heath Stewart16-Jan-03 11:30
protectorHeath Stewart16-Jan-03 11:30 
GeneralRe: Fullscreen forms? Pin
p daddy16-Jan-03 22:21
p daddy16-Jan-03 22:21 
GeneralRe: Fullscreen forms? Pin
Zibar16-Jan-03 22:34
sussZibar16-Jan-03 22:34 
AnswerRe: Fullscreen forms? Pin
Uwe Keim18-Jan-03 1:19
sitebuilderUwe Keim18-Jan-03 1:19 
GeneralRelative path to Web Services from a .NET Winform Pin
shanelhatcher16-Jan-03 5:31
shanelhatcher16-Jan-03 5:31 
GeneralRe: Relative path to Web Services from a .NET Winform Pin
Heath Stewart16-Jan-03 11:07
protectorHeath Stewart16-Jan-03 11:07 
GeneralRaised Panels can you create them. Pin
S S Basra16-Jan-03 4:36
S S Basra16-Jan-03 4:36 
GeneralRe: Raised Panels can you create them. Pin
FruitBatInShades16-Jan-03 6:58
FruitBatInShades16-Jan-03 6:58 
GeneralRe: Raised Panels can you create them. Pin
Heath Stewart16-Jan-03 11:09
protectorHeath Stewart16-Jan-03 11:09 
GeneralRe: Raised Panels can you create them. Pin
S S Basra17-Jan-03 1:47
S S Basra17-Jan-03 1:47 
GeneralContext menu not displaying! Pin
FruitBatInShades16-Jan-03 4:21
FruitBatInShades16-Jan-03 4:21 
GeneralRe: Context menu not displaying! Pin
Stephane Rodriguez.16-Jan-03 4:39
Stephane Rodriguez.16-Jan-03 4:39 
GeneralRe: Context menu not displaying! Pin
FruitBatInShades16-Jan-03 5:16
FruitBatInShades16-Jan-03 5:16 
GeneralRe: Context menu not displaying! Pin
FruitBatInShades16-Jan-03 7:40
FruitBatInShades16-Jan-03 7:40 

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.