2个回答
展开全部
//我用的winform做的,单面功能可以,但是解密估计还待实现
private void btnEncry_Click(object sender, EventArgs e)//btnEncry_Click是界面一个按钮的单击事件
{
string before = txtBefore.Text.Trim();//获取输入字符串
string after = string.Empty;//定义空串用来存放加密过后的字符串
for (int i = 0; i < before.Length; i++)//0,1,2,3
{
char afterThree = before[(i + 3)%before.Length];//将当前字符变成之后的第三个字母,循环求余
after += afterThree;//获得第一步之后的字符串
}
//进行对X,x替换
after = after.Replace("X","A");
after = after.Replace("Y","B");
after = after.Replace("Z","C");
after = after.Replace("x", "a");
after = after.Replace("y", "b");
after = after.Replace("z", "c");
txtAfter.Text = after;//最终的after就是加密过后的值
}
private void btnEncry_Click(object sender, EventArgs e)//btnEncry_Click是界面一个按钮的单击事件
{
string before = txtBefore.Text.Trim();//获取输入字符串
string after = string.Empty;//定义空串用来存放加密过后的字符串
for (int i = 0; i < before.Length; i++)//0,1,2,3
{
char afterThree = before[(i + 3)%before.Length];//将当前字符变成之后的第三个字母,循环求余
after += afterThree;//获得第一步之后的字符串
}
//进行对X,x替换
after = after.Replace("X","A");
after = after.Replace("Y","B");
after = after.Replace("Z","C");
after = after.Replace("x", "a");
after = after.Replace("y", "b");
after = after.Replace("z", "c");
txtAfter.Text = after;//最终的after就是加密过后的值
}
追问
额,感觉好复杂啊,不过谢谢你哟,有基本的操作木有啊?我们现在学的是Visual foxpro
追答
VFP是数据库了。。。这个还用不到数据库啊!!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询