Click here to Skip to main content
15,906,624 members
Home / Discussions / C#
   

C#

 
GeneralRe: Set the text on a textbox in form load with registry values. Pin
CodingLover2-Mar-08 17:54
CodingLover2-Mar-08 17:54 
GeneralRe: Set the text on a textbox in form load with registry values. Pin
dipak.dipak2-Mar-08 19:01
dipak.dipak2-Mar-08 19:01 
GeneralRe: Set the text on a textbox in form load with registry values. Pin
CodingLover2-Mar-08 19:58
CodingLover2-Mar-08 19:58 
GeneralRe: Set the text on a textbox in form load with registry values. Pin
DaveyM692-Mar-08 23:20
professionalDaveyM692-Mar-08 23:20 
GeneralRe: Set the text on a textbox in form load with registry values. Pin
CodingLover2-Mar-08 23:34
CodingLover2-Mar-08 23:34 
GeneralRe: Set the text on a textbox in form load with registry values. Pin
DaveyM693-Mar-08 1:06
professionalDaveyM693-Mar-08 1:06 
GeneralMonitoring Internet Traffic Pin
aj.esler2-Mar-08 15:31
aj.esler2-Mar-08 15:31 
GeneralRe: Monitoring Internet Traffic Pin
Laubi2-Mar-08 20:16
Laubi2-Mar-08 20:16 
QuestionHow Pinged me??? Pin
nelsonpaixao2-Mar-08 14:57
nelsonpaixao2-Mar-08 14:57 
GeneralRe: How Pinged me??? Pin
Laubi2-Mar-08 20:18
Laubi2-Mar-08 20:18 
GeneralListboxes ... finding certain numbers Pin
Jacob Dixon2-Mar-08 14:32
Jacob Dixon2-Mar-08 14:32 
GeneralRe: Listboxes ... finding certain numbers Pin
Anthony Mushrow2-Mar-08 14:40
professionalAnthony Mushrow2-Mar-08 14:40 
GeneralRe: Listboxes ... finding certain numbers Pin
Jacob Dixon2-Mar-08 14:47
Jacob Dixon2-Mar-08 14:47 
GeneralRe: Listboxes ... finding certain numbers Pin
Luc Pattyn2-Mar-08 15:20
sitebuilderLuc Pattyn2-Mar-08 15:20 
GeneralRe: Listboxes ... finding certain numbers Pin
aj.esler2-Mar-08 14:49
aj.esler2-Mar-08 14:49 
GeneralRe: Listboxes ... finding certain numbers Pin
Jacob Dixon2-Mar-08 14:54
Jacob Dixon2-Mar-08 14:54 
AnswerRe: Listboxes ... finding certain numbers Pin
dipak.dipak2-Mar-08 19:25
dipak.dipak2-Mar-08 19:25 
QuestionHow to load Kernel32.dll and use GetSystemInfo(...) Pin
gshen2-Mar-08 12:59
gshen2-Mar-08 12:59 
AnswerRe: How to load Kernel32.dll and use GetSystemInfo(...) Pin
Anthony Mushrow2-Mar-08 14:14
professionalAnthony Mushrow2-Mar-08 14:14 
AnswerRe: How to load Kernel32.dll and use GetSystemInfo(...) Pin
Luc Pattyn2-Mar-08 15:22
sitebuilderLuc Pattyn2-Mar-08 15:22 
GeneralOpening multiple files Pin
Jacob Dixon2-Mar-08 10:16
Jacob Dixon2-Mar-08 10:16 
GeneralRe: Opening multiple files Pin
Giorgi Dalakishvili2-Mar-08 10:22
mentorGiorgi Dalakishvili2-Mar-08 10:22 
When you create one stream from another you should first close the newly created one and then the base one. So this snippet

FileStream ChildFile = new FileStream(thepath + @"Child\Child.daycare", FileMode.Create);
StreamWriter Childsw = new StreamWriter(ChildFile);
Childsw.WriteLine(fullnameTextbox.Text);
Childsw.WriteLine(birthTextbox.Text);
Childsw.WriteLine(startTextbox.Text);
ChildFile.Close();
Childsw.Close();


should be like this:

FileStream ChildFile = new FileStream(thepath + @"Child\Child.daycare", FileMode.Create);
StreamWriter Childsw = new StreamWriter(ChildFile);
Childsw.WriteLine(fullnameTextbox.Text);
Childsw.WriteLine(birthTextbox.Text);
Childsw.WriteLine(startTextbox.Text);
Childsw.Close();
ChildFile.Close();


Also, use using block with streams so that they will be closed and disposed automatically

#region signature
my articles
#endregion

GeneralRe: Opening multiple files Pin
Jacob Dixon2-Mar-08 10:24
Jacob Dixon2-Mar-08 10:24 
GeneralRe: Opening multiple files Pin
Jacob Dixon2-Mar-08 10:28
Jacob Dixon2-Mar-08 10:28 
GeneralRe: Opening multiple files Pin
Giorgi Dalakishvili2-Mar-08 10:50
mentorGiorgi Dalakishvili2-Mar-08 10:50 

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.