Puedes guardar el password en fomato binario.
Código (csharp) [Seleccionar]
short agno = 2005;
decimal ingresos = 46762993;
bool anotado = true;
StreamWriter Texto = new StreamWriter("Archivo.txt");
Texto.Write(agno);
Texto.Write(ingresos);
Texto.Write(anotado);
Texto.Close();
FileStream Archivo = new FileStream("Archivo.txt", FileMode.Append);
BinaryWriter Binario = new BinaryWriter(Archivo);
Binario.Write(agno);
Binario.Write(ingresos);
Binario.Write(anotado);
Archivo.Close();
Código (csharp) [Seleccionar]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Alarma_01
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
short agno = 2005;
decimal ingresos = 46762993;
bool anotado = true;
private void Form1_Load(object sender, EventArgs e)
{
String palabra = "hrtola";
if (palabra == "hola")
{
StreamWriter Texto = new StreamWriter("Archivo.txt");
Texto.Write(agno);
Texto.Write(ingresos);
Texto.Write(anotado);
Texto.Close();
MessageBox.Show("Programa cargado correctamente", "Información:",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
FileStream Archivo = new FileStream("Archivo.txt", FileMode.Append);
BinaryWriter Binario = new BinaryWriter(Archivo);
Binario.Write(agno);
Binario.Write(ingresos);
Binario.Write(anotado);
Archivo.Close();
MessageBox.Show("Progama bloqueado Ingrese password", "Para:",
MessageBoxButtons.OK, MessageBoxIcon.Stop);
Application.Exit();
}
}
}
}