Click here to Skip to main content
12,694,352 members (33,685 online)
Click here to Skip to main content
Articles » Languages » C# » General » Downloads

Tagged as


15 bookmarked

Achieve Persistence Through Serialization

, 6 Jan 2011 CPOL
This article compares the two common types of serialization in aspects of data access, readability, and runtime cost.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Drawing;
using System.Xml.Serialization;

namespace Trestan
    class Program
        static void Main(string[] args)
            Console.WriteLine("Normally we will create GUI for user interaction. Here we just use console as a demo.\n");
            Console.WriteLine("Configuration settings:\n");
            Console.WriteLine("ServerIP: "+Configuration.Instance.ServerIP);
            Console.WriteLine("ServerPort: " + Configuration.Instance.ServerPort);
            Console.WriteLine("UserName: " + Configuration.Instance.CurrentUser.UserName);
            Console.WriteLine("UserID: " + Configuration.Instance.CurrentUser.UserID);
            Console.WriteLine("\nPlease input user name: ");
            Configuration.Instance.CurrentUser.UserName = Console.ReadLine();
            Configuration.Instance.CurrentUser.UserID = 1001;   //In real application, this value will be obtained from server side after athentication.
            Configuration.Instance.ServerIP = Utility.getHostIP();

            Console.WriteLine("Press enter to exit. Run the program again will show new settings.");

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


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


About the Author

Team Leader
Canada Canada
Looking for something to do in the new year.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170118.1 | Last Updated 6 Jan 2011
Article Copyright 2011 by trestan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid