示例#1
0
        public static void Testa()
        {
            var novoCadastro = new FormularioCadastro
            {
                Nome  = "Gui",
                Email = "*****@*****.**",
                Senha = "senha super dificil e complicada de lembrar"
            };

            using (var arquivo = File.Create("cadastro.bin"))
            {
                var formatador = new BinaryFormatter();
                formatador.Serialize(arquivo, novoCadastro);
            }
        }
        public static void Testa()
        {
            var novoCadastro = new FormularioCadastro
            {
                Nome  = "Fillipe",
                Email = "*****@*****.**",
                Senha = "senha super dificil"
            };

            using (var arquivo = File.Create("cadastro.bin"))
            {
                var formatador = new BinaryFormatter();
                formatador.Serialize(arquivo, novoCadastro);
            }
        }