Click here to Skip to main content
15,918,211 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
XRaheemX11-Oct-05 7:58
XRaheemX11-Oct-05 7:58 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
Dan Neely11-Oct-05 8:26
Dan Neely11-Oct-05 8:26 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
Dave Kreskowiak11-Oct-05 9:23
mveDave Kreskowiak11-Oct-05 9:23 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
Dan Neely11-Oct-05 9:31
Dan Neely11-Oct-05 9:31 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
Dave Kreskowiak11-Oct-05 9:40
mveDave Kreskowiak11-Oct-05 9:40 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
XRaheemX11-Oct-05 11:06
XRaheemX11-Oct-05 11:06 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
evrastil11-Oct-05 22:02
evrastil11-Oct-05 22:02 
GeneralRe: Can u help? I need to save data from label to file on hard drive Pin
XRaheemX12-Oct-05 3:22
XRaheemX12-Oct-05 3:22 
Well, for the simple one line of text in a file you won't need to parse anything. You can simply do just the opposite of what I have above. Check if the file exists but don't delete it. Instead of using File.CreateText you will use File.OpenText. Instead of using System.IO.TextWriter use a System.IO.TextReader. Instead of using WriteLine() use ReadLine(). It's all pretty simple. However, if you're putting multiple lines in the file for multiple objects/properties it does get a little more complex. A more simple way to do this would be to just serialize the label (or whatever other oject you have) into a file and deserialize it back from the file to an object in the code whenever you need it. A good example exists right here on code project:

http://www.codeproject.com/csharp/objserial.asp[^]
QuestionProperties in structures Pin
chettu11-Oct-05 6:14
chettu11-Oct-05 6:14 
AnswerRe: Properties in structures Pin
XRaheemX11-Oct-05 7:12
XRaheemX11-Oct-05 7:12 
GeneralRe: Properties in structures Pin
David Stone11-Oct-05 7:20
sitebuilderDavid Stone11-Oct-05 7:20 
GeneralRe: Properties in structures Pin
XRaheemX11-Oct-05 7:24
XRaheemX11-Oct-05 7:24 
GeneralRe: Properties in structures Pin
David Stone11-Oct-05 7:29
sitebuilderDavid Stone11-Oct-05 7:29 
GeneralRe: Properties in structures Pin
XRaheemX11-Oct-05 7:29
XRaheemX11-Oct-05 7:29 
AnswerRe: Properties in structures Pin
David Stone11-Oct-05 7:19
sitebuilderDavid Stone11-Oct-05 7:19 
QuestionSetting Value for the new row in a DataGrid Pin
miah alom11-Oct-05 5:56
miah alom11-Oct-05 5:56 
AnswerRe: Setting Value for the new row in a DataGrid Pin
miah alom11-Oct-05 6:01
miah alom11-Oct-05 6:01 
Questiondashed lines -- way to get equal length dashes? Pin
...---...11-Oct-05 4:31
...---...11-Oct-05 4:31 
AnswerRe: dashed lines -- way to get equal length dashes? Pin
XRaheemX11-Oct-05 4:59
XRaheemX11-Oct-05 4:59 
GeneralRe: dashed lines -- way to get equal length dashes? Pin
...---...11-Oct-05 8:37
...---...11-Oct-05 8:37 
QuestionDateTimePicker and Regional Setting Pin
AesopTurtle11-Oct-05 4:24
AesopTurtle11-Oct-05 4:24 
AnswerRe: DateTimePicker and Regional Setting Pin
XRaheemX11-Oct-05 4:53
XRaheemX11-Oct-05 4:53 
GeneralRe: DateTimePicker and Regional Setting Pin
AesopTurtle11-Oct-05 15:28
AesopTurtle11-Oct-05 15:28 
GeneralRe: DateTimePicker and Regional Setting Pin
XRaheemX12-Oct-05 3:12
XRaheemX12-Oct-05 3:12 
QuestionHow to scroll an image? Pin
E6AD11-Oct-05 4:12
E6AD11-Oct-05 4:12 

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.