コード例 #1
0
        public static void print()
        {
            infos inf = new infos();

            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.Clear();
            Console.WriteLine("HighSCorer: " + highname); Console.WriteLine("\nKeyPresses: " + highscore);
            Console.Write("\n\n\n\t\t\t|{0}|\t\t|{1}|\t\t|{2}|\t\t\t\n\n\n\t\t\t|{3}|\t\t|{4}|\t\t|{5}|\t\t\t\n\n\n\t\t\t|{6}|\t\t|{7}|\t\t|{8}|\t\t\t\n", numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], numbers[6], numbers[7], numbers[8]);
            Console.WriteLine("\n\nNow playing: " + currentuser + "\n\n" + "Your KeyPresses: " + moves);
            Console.Write("\n\n\nSwap 0 using arrow keys\t\tPress 'D' to Submit");
        }
コード例 #2
0
        public void Reader()
        {
            infos         inf   = new infos();
            XmlSerializer xmlsr = new XmlSerializer(inf.GetType());

            File.Create("info.xml");
            object disp = xmlsr.Deserialize(r);

            inf = (infos)disp;
            Console.WriteLine("Reading..");
            highname  = inf.names;
            highscore = inf.scores;
            r.Close();
        }
コード例 #3
0
        public void writer()
        {
            r.Close();
            infos inf = new infos();

            Console.Clear();
            Console.WriteLine("Error in reading records:\nEnter your name new user");
            inf.names  = Console.ReadLine();
            inf.scores = 0;
            XmlSerializer xmlsr = new XmlSerializer(inf.GetType());
            StreamWriter  w     = new StreamWriter("info.xml");

            xmlsr.Serialize(w, inf);
            Console.WriteLine("Writing complete");
            w.Flush();
            w.Close();
        }