adding information to a file without overwriting old info
-
Hey everybody! lets say I have a file with the following information: string name: "StringName0" and its value is "Text0". now, I want the user to enter more text but it will be saved under a different "StringName", but if I will try to serialize only the new text all I will have in my file is this: "StringName1" and the value "Text1", without "StringName0" and "Text0", it will overwrite the old infomation, what I want to know if there is a way to add the new "StringName" while keeping the old one. maybe I will explain my final goal and than maybe everything will be clearer. I am trying to make a user list for my app, so a new user will enter his "Name", "UserName" and "Password". and there will be a listbox that will contain all Names (so the users can choose themselves). what I am trying to do is that when a new user will add himself, it will ADD the new info into the file without replacing the other users... I am trying to work on this for a long time, and everytime I encounter new problems and I'm really close to give up, so PLEASE HELP ME!!! :(( Thanks in advance!
-
Hey everybody! lets say I have a file with the following information: string name: "StringName0" and its value is "Text0". now, I want the user to enter more text but it will be saved under a different "StringName", but if I will try to serialize only the new text all I will have in my file is this: "StringName1" and the value "Text1", without "StringName0" and "Text0", it will overwrite the old infomation, what I want to know if there is a way to add the new "StringName" while keeping the old one. maybe I will explain my final goal and than maybe everything will be clearer. I am trying to make a user list for my app, so a new user will enter his "Name", "UserName" and "Password". and there will be a listbox that will contain all Names (so the users can choose themselves). what I am trying to do is that when a new user will add himself, it will ADD the new info into the file without replacing the other users... I am trying to work on this for a long time, and everytime I encounter new problems and I'm really close to give up, so PLEASE HELP ME!!! :(( Thanks in advance!
try to open the file with FileMode: FileMode.Append -- Rocky Dean Pulley
-
try to open the file with FileMode: FileMode.Append -- Rocky Dean Pulley
my god! it works! :-) Thank You! it really saves again, but I have one more question to understand how exatcly should I load the information. lets say that I'm saving every time using the same "StringName" and only the value changes. and as I saw using the Append it does not overwrite even if it is using the same "StringName", I want to know if there is anyway to load all the values even though all of them has the same StringName of must I create StringName0 and its value, StringName1 and its value, etc. Thanks Alot!!!