Professional Documents
Culture Documents
mã hóa hoán vị app
mã hóa hoán vị app
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Docfileluufile
public Form1()
InitializeComponent();
FileStream st;
int cot = 5;
if (op.ShowDialog() == DialogResult.OK)
txtlink.Text = op.FileName;
btthuchien.Enabled = false;
//Random so
if (txtlink.Text == string.Empty)
else
// try
// {
if (rdmahoa.Checked)
if (File.Exists(txtlink.Text))
int sodu = 0;
if(st.Length%cot!=0)
int h = 0;
// doc file
tailieufile[h] = (byte)st.ReadByte();
h++;
else
mang[j, i] =254;
st.Close();
hv[i] = i;
byte[] kqq;
//{
//}
//else
//{
//}
int sokt = 0;
sokt++;
//Xep file
if (sv.ShowDialog() == DialogResult.OK)
f.Write(Encoding.UTF8.GetBytes(sodu.ToString()), 0, 1);
f.Write(kqq, 0, kqq.Length);
btthuchien.Enabled = true;
f.Close();
if (rdgm.Checked)
if (File.Exists(txtlink.Text))
int hang = 0;
if((st.Length-2)%cot==0)
else
int h = 0;
int soo = 0;
if(h==0)
sodem[0] = (byte)st.ReadByte();
sogm = Encoding.UTF8.GetString(sodem);
h++;
if(h==1)
dodai[0] = (byte)st.ReadByte();
h++;
// ghi du lieu ra
tailieufile[soo] = (byte)st.ReadByte();
soo++;
}
}
st.Close();
hv[i] = i;
else
byte[] kqq;
int sokt = 0;
if((int.Parse(Encoding.UTF8.GetString(dodai)))==0)
sokt++;
else
if (sokt<kqq.Length)
sokt++;
if (sv.ShowDialog() == DialogResult.OK)
f.Write(kqq, 0, kqq.Length);
btthuchien.Enabled = true;
f.Close();
//catch
//{
//}
rdmahoa.Checked = true;