Click here to Skip to main content
15,886,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to modify the content inside the files.
Inside we have First line having the date and time some number & Guid's and CRC count.
Ex:2015/02/02 09:05:26 123456.35625 ADXBH789-YU78-YUG7-KL9I-ADJKH789 78
In Each time if i press The Button The First Line should changed with CurrentDate &Time and Numbers NewGuid's and New CRC.

Can anyone help me to solve this.
Using MFC VC++
Posted
Updated 7-Apr-15 3:42am
v3
Comments
Sergey Alexandrovich Kryukov 7-Apr-15 9:43am    
If has nothing to do with MFC and even with Windows.
What have you tried so far?
—SA

1 solution

If your number is fixed length, then it's pretty simple: just open the file for read-write access, write the new information into the file (making sure it's a fixed size write rather than line based), close the file.

If your number is not a fixed length, then it's a lot nastier:
Open the fire for read, open a new file for write.
Read the first line and discard.
Write the new first line.
Copy the rest of the file.
Close both files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900