import java.security.MessageDigest;
String md5(String in) {
String result = null;
try
{
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.reset();
digest.update(in.getBytes());
BigInteger bigInt = new BigInteger(1, digest.digest());
result = bigInt.toString(16);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return result;
}
private void MyForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason != CloseReason.WindowsShutDown)
{
// Ваш код
}
}