工具:Visual Studio 2008
SQL Server 2008
Windows XP
Form1:
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.Data.SqlClient;
using System.Security.Cryptography;
namespace loginVs
{
public partial class Form1 : Form
{
public bool b1 = false;
public Form1()
{
InitializeComponent();
}
private string MD5Create(string STR) //STR为待加密的string
{
string pwd = "";
//pwd为加密结果
MD5 md5 = MD5.Create();
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(STR));
//这里的UTF8是编码方式,你可以采用你喜欢的方式进行,比如UNcode等等
for (int i = 0; i < s.Length; i++)
{
pwd = pwd + s[i].ToString();
}
return pwd;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
i