或者就直接使用sql语句实现也行!!!
解决方案 »
- Response.Write() 无法调用前台js脚本函数
- 如何实现,网页开着,不刷新,session也不失效
- 求解密 eval function ///7
- 继续再刚才的问题,马上就做出来啦。。。。。。。在线等
- 如何在ASP.NET的客户端调用DLL类库
- multiline textbox problem
- 高手请进~~大家帮我看一下这里的定单datagird--多窗口---是怎么实现的?
- 有关下拉框(dropdowlist)绑定数据库中数据的问题,请各位帮忙,表示感谢了!!!!
- 怎样解决交叉脚本问题
- asp.net的web服务器主要有哪些啊?
- 在DBGrid里,加入了一"修改"列,希望在点击某行的"修改"的时候,能取到该行的某个字段的值。我该怎么做呢?
- 有成都的asp.net高手吗?多多指教
private string Run_MD5(string strText)
{
byte[] md5Bytes = System.Text.Encoding.Unicode.GetBytes(strText);
MD5CryptoServiceProvider md5Encrypt = new MD5CryptoServiceProvider();
byte[] EncryptString= md5Encrypt.ComputeHash(md5Bytes);
strText = System.Text.Encoding.Unicode.GetString(EncryptString);
return strText;
}
using System.Web.Security;
using System.Security.Cryptography;
{
System.Security.Cryptography.MD5CryptoServiceProvider obj = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] bInput = System.Text.Encoding.Default.GetBytes(inputString);
byte[] bRet=obj.ComputeHash(bInput);
string res ="";
for (int i=0;i<bRet.Length;i++)
{
res += bRet[i].ToString().PadLeft(2,'0');
}
return res; }
数据结构里面最经典的
using System.Web.Security;string strHashPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "md5"或者"sha1");把strHashPassword存到数据库即可 也就是你的char型.......
Public Function EncryptPassword(ByVal normal As String) As String
Dim varEncrypt As String
Dim newString As String
Dim temp As Double
Dim temp2 As Double
Dim temp3 As Double
Dim temp4 As Double
Dim i, j As Integer
Dim xarray(25) As Integer
Dim Count As Integer
On Error GoTo errHandle
xarray(0) = 12
xarray(1) = 9
xarray(2) = 13
xarray(3) = 19
xarray(4) = 10
xarray(5) = 3
xarray(6) = 6
xarray(7) = 2
xarray(8) = 11
xarray(9) = 15
xarray(10) = 1
xarray(11) = 24
xarray(12) = 16
xarray(13) = 8
xarray(14) = 4
xarray(15) = 5
xarray(16) = 25
xarray(17) = 7
xarray(18) = 14
xarray(19) = 21
xarray(20) = 6
xarray(21) = 20
xarray(22) = 22
xarray(23) = 18
xarray(24) = 23
xarray(25) = 17
newString = ""
Count = 0
For i = 1 To Len(normal)
If Count = 25 Then Count = 0
temp = Asc(Mid(normal, i, 1))
temp2 = xarray(Count)
temp3 = temp Xor temp2
'Calculations
temp3 = Abs(temp3)
If temp3 = 39 Then temp3 = 128
newString = newString & Chr(temp3)
Count = Count + 1
Next i
EncryptPassword = newString
Exit Function
errHandle:
MM1_FormatError (MM1_SetError(Err.Number, Err.Description, App.EXEName, "EncryptPassWord"))
End Function'解密口令串
Public Function DecryptPassword(ByVal normal As String) As String
Dim varEncrypt As String
Dim newString As String
Dim temp As Double
Dim temp2 As Double
Dim temp3 As Double
Dim temp4 As Double
Dim i, j As Integer
Dim xarray(25) As Integer
Dim Count As Integer
On Error GoTo errHandle
xarray(0) = 12
xarray(1) = 9
xarray(2) = 13
xarray(3) = 19
xarray(4) = 10
xarray(5) = 3
xarray(6) = 6
xarray(7) = 2
xarray(8) = 11
xarray(9) = 15
xarray(10) = 1
xarray(11) = 24
xarray(12) = 16
xarray(13) = 8
xarray(14) = 4
xarray(15) = 5
xarray(16) = 25
xarray(17) = 7
xarray(18) = 14
xarray(19) = 21
xarray(20) = 6
xarray(21) = 20
xarray(22) = 22
xarray(23) = 18
xarray(24) = 23
xarray(25) = 17
newString = ""
Count = 0
For i = 1 To Len(normal)
If Count = 25 Then Count = 0
temp = Asc(Mid(normal, i, 1))
If temp = 128 Then temp = 39
temp2 = xarray(Count)
temp3 = temp Xor temp2
'Calculations
temp3 = Abs(temp3)
newString = newString & Chr(temp3)
Count = Count + 1
Next i
DecryptPassword = newString
Exit Function
errHandle:
MM1_FormatError (MM1_SetError(Err.Number, Err.Description, App.EXEName, "DecryptPassword"))
End Function
this.Label2.Text=FormsAuthentication.HashPasswordForStoringInConfigFile(this.TextBox1.Text,"MD5");