Exemple #1
0
        private void ResultsForm_Load(object sender, EventArgs e)
        {
            List <Player> myLeaderboard = DataAdapter.GetWinners();

            foreach (Player winner in myLeaderboard)
            {
                lstBxLeaderboard.Items.Add(winner);
            }
        }
        public static void SerializeNow(Player myPlayer)
        {
            MemoryStream myStream = new MemoryStream();

            BinaryFormatter myFormat = new BinaryFormatter();

            myFormat.Serialize(myStream, myPlayer);

            string serializedValue = Convert.ToBase64String(myStream.ToArray());

            DataAdapter.Insert(serializedValue);

            myStream.Close();
        }