Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
GeneralRe: Shape moving across screen HELP! Pin
thepersonof5-Dec-04 4:48
thepersonof5-Dec-04 4:48 
GeneralRe: Shape moving across screen HELP! Pin
Anonymous5-Dec-04 11:08
Anonymous5-Dec-04 11:08 
GeneralRe: Shape moving across screen HELP! Pin
Stanciu Vlad5-Dec-04 5:45
Stanciu Vlad5-Dec-04 5:45 
GeneralCatching Stack Unwinding Pin
tbpub4-Dec-04 9:12
tbpub4-Dec-04 9:12 
GeneralLDAP Query Using Directory Services Pin
Member 7756734-Dec-04 6:33
Member 7756734-Dec-04 6:33 
Generalvideo conf. Pin
Sakkijha4-Dec-04 4:28
Sakkijha4-Dec-04 4:28 
GeneralRe: video conf. Pin
tom_dx4-Dec-04 13:07
tom_dx4-Dec-04 13:07 
GeneralFileStream : Problem in Reading File Pin
Zishan Haider4-Dec-04 2:45
Zishan Haider4-Dec-04 2:45 
hello,

I have a FileStream object in an OnChange event. Everytime OnChange is called, the code goes like this :

private void OnChanged(object source, FileSystemEventArgs e)
{

byte [] data = new byte[100];
try
{
fs.Read(data,offSet,fs.Length-offSet);
offSet = fs.Length;
changedText = trim(Encoding.ASCII.GetString(data));
doOperations(changedText);
}
catch(Exception ee)
{}

}

Now suppose on first OnChange call, 50 bytes were read, filling up the byte array (data) from index 0 to 49. The Problem starts on the next OnChange call. It continues to fill my byte array from 50 onwards, which finally results in the System.ArgumentException, when it reaches the array length 100. I need my byte array to be filled from 0 everytime OnChange is called. How can I do it?

regards
Zishan
GeneralRe: FileStream : Problem in Reading File Pin
Stanciu Vlad4-Dec-04 8:24
Stanciu Vlad4-Dec-04 8:24 
GeneralTranslation matrix and roation angle Pin
montu33774-Dec-04 2:10
montu33774-Dec-04 2:10 
GeneralRe: Translation matrix and roation angle Pin
tom_dx4-Dec-04 13:09
tom_dx4-Dec-04 13:09 
GeneralRe: Translation matrix and roation angle Pin
Alex Korchemniy4-Dec-04 16:46
Alex Korchemniy4-Dec-04 16:46 
GeneralRe: Translation matrix and roation angle Pin
montu33774-Dec-04 20:06
montu33774-Dec-04 20:06 
GeneralScrolling RichTextBox Pin
Toximus4-Dec-04 1:20
Toximus4-Dec-04 1:20 
GeneralRe: Scrolling RichTextBox Pin
leppie4-Dec-04 2:29
leppie4-Dec-04 2:29 
GeneralRe: Scrolling RichTextBox Pin
Toximus4-Dec-04 23:48
Toximus4-Dec-04 23:48 
GeneralRe: Scrolling RichTextBox Pin
leppie5-Dec-04 7:33
leppie5-Dec-04 7:33 
GeneralBackGround Windows Form Pin
camposeo793-Dec-04 23:44
camposeo793-Dec-04 23:44 
GeneralRe: BackGround Windows Form Pin
Robert Rohde4-Dec-04 8:28
Robert Rohde4-Dec-04 8:28 
GeneralRe: BackGround Windows Form Pin
Alex Korchemniy4-Dec-04 16:43
Alex Korchemniy4-Dec-04 16:43 
GeneralNot all files are removed, when the program is uninstalled Pin
Bjoern.adG3-Dec-04 23:00
Bjoern.adG3-Dec-04 23:00 
GeneralRe: Not all files are removed, when the program is uninstalled Pin
Daniel Turini3-Dec-04 23:08
Daniel Turini3-Dec-04 23:08 
Generaldesign question. Pin
jtmtv183-Dec-04 22:11
jtmtv183-Dec-04 22:11 
GeneralRe: design question. Pin
Daniel Turini3-Dec-04 23:05
Daniel Turini3-Dec-04 23:05 
GeneralRe: design question. Pin
leppie4-Dec-04 1:17
leppie4-Dec-04 1:17 

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.