Save and Load Dictionary from encrypted or unreadable or binary format ?

Posted by Prix on Stack Overflow See other posts from Stack Overflow or by Prix
Published on 2010-12-26T20:47:54Z Indexed on 2010/12/26 20:53 UTC
Read the original article Hit count: 212

Filed under:
|
|
|
|

I have a dictionary like the follow:

public Dictionary<int, SpawnList> spawnEntities = new Dictionary<int, SpawnList>();

The class being used is as follow:

    public class SpawnList
    {
        public int NpcID { get; set; }
        public string Name { get; set; }
        public int Level { get; set; }
        public int TitleID { get; set; }
        public int StaticID { get; set; }

        public entityType Status { get; set; }

        public int TypeA { get; set; }
        public int TypeB { get; set; }
        public int TypeC { get; set; }

        public int ZoneID { get; set; }
        public int Heading { get; set; }
        public float PosX { get; set; }
        public float PosY { get; set; }
        public float PosZ { get; set; }
    }

/// <summary>Entity type enum.</summary>
public enum entityType
{
    Ally,
    Enemy,
    SummonPet,
    NPC,
    Object,
    Monster,
    Gatherable,
    Unknown
}

How could I save this Dictionary to either a binary or encrypted format so I could later Load it again into my application ?

My limitation is .Net 3.5 can't use anything higher.

© Stack Overflow or respective owner

Related posts about c#

Related posts about encryption