Question : Serialize && Deserialize objects in c#

Hi!

I've to serialize data.

An example of my structure:

DataStore
--->Users
-------->User1
-------------->Name
-------------->Firstname
-------->User2
-------------->Name
-------------->Firstname
--->Groups
-------->Group1
--------------->Name
--------------->Users
--------------------->User1(this user will be in the users list but not all users will be in the group list)

I only need this on public attribute fields, so it should be easy no?

I saw some things( http://www.switchonthecode.com/tutorials/csharp-tutorial-serialize-objects-to-a-file) but it seems I've to specify again all fields. Because I want directly to have all my subfields, how can I do this fastly?

Thank you!

Answer : Serialize && Deserialize objects in c#

better :

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
<head>
<title>Temperatur</title>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
<script language="JavaScript" type="text/javascript">
<!--
		function graderfahrenheit()
		{
			document.forms["formular"].fahrenheit.value = document.forms["formular"].celsius.value*(9/5)+32
		}
//-->
</script>
</head>
<body>
    <form name="formular">
        <input type="text" name="celsius" size="4" />°C &nbsp;&nbsp;
        <input type="button" value="Konvertera till Fahrenheit" onClick="graderfahrenheit()" /> &nbsp;>>>
        <input type="text" name="fahrenheit" size="4" />°F
    </form>
</body>
</html>
Random Solutions  
 
programming4us programming4us