ÖØÖÃASP.NET¡¡membership¼ÓÃܺóµÄÃÜÂë
ÕâÀïÎÒֻժȡÁËÔÎĵÄCodeÒÔ¹©Ç±ÐÄÑо¿.using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Web.Security;
using System.Data;
public partial class ResetPassword : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
// ÖØÖÃ
protected void btnReset_Click(object sender, EventArgs e)
{
string connStr = WebConfigurationManager.ConnectionStrings["conn"].ToString();
string username = txtUserName.Text.Trim();
if (username.Length==0)
{
Response.Write("ÇëÊäÈëÓû§Ãû£¡");
return;
}
//=== ²úÉú¼ÓÃÜÓõÄÃÜÂëÃÜÔ¿ ===
string salt = GenerateSalt();
//=== ½«Ã÷ÂëÃÜÂë¼ÓÃÜ(´ËʱÃÜÂëΪ"P@ssw0rd" µ±È»Ò²¿ÉËæ»úÊýÉú³É) ===
string password = EncryptToHashString("123456", salt, "SHA1");
SqlConnection conn = new SqlConnection(connStr);
conn.Open();
//=== ÔÚ´ËÎÒÃǺô½Ð Membership ÌṩÕß Êý¾Ý¿âÀïµÄÔ¤´æ³ÌÐòÀ´ÖØÖÃÃÜÂë ===
SqlCommand cmd = new SqlCommand("aspnet_Membership_SetPassword", conn);
cmd.CommandType = CommandType.StoredProcedure;
//=== ĿǰʹÓà Membership ÌṩÕßµÄ web Ó¦ÓóÌÐòÃû³Æ ===
cmd.Parameters.Add(new SqlParameter("@ApplicationName", Membership.ApplicationName));
//=== ÒªÖØÖÃÃÜÂëµÄÓû§Õ˺Š===
cmd.Parameters.Add(new SqlParameter("@UserName", username));
//=== ¼ÓÃܹýµÄÃÜÂë ===
cmd.Parameters.Add(new SqlParameter("@NewPassword", password));
//=== ÃÜÂë¼ÓÃÜÃÜÔ¿(Ò»¶¨ºÍʹÓüÓÃÜÃÜÂëµÄÃÜÔ¿Ò»Ñù£¬²»ÒªÔÙÖØÐ²úÉú) ===
cmd.Parameters.Add(new SqlParameter("@PasswordSalt", salt));
//=== ÖØÖÃÃÜÂëµÄʱ¼ä ===
cmd.Parameters.Add(new SqlParameter("@CurrentTimeUtc", DateTime.Now));
//=== ÃÜÂë¼ÓÃܵĸñʽ(´ËʱÊÇHash1£¬×¢Òâ´«Èë²ÎÊý
Ïà¹ØÎĵµ£º
ÓкܾÃÒ»¶Îʱ¼äÎÒµÄBLOGÉÏûÓгöÏÖAJAXÏà¹ØÑ¶Ï¢ÁË£¬Ö÷Òªµ±È»ÊÇÒòΪ¾ø´ó²¿·ÖµÄÖØÐͼ·Åµ½ÁËSilverlightÉíÉÏ(¿ÉÔ¤ÆÚµÄδÀ´Ó¦¸ÃÒ²»áÊÇÈç´Ë)¡£
µ«ÓÉÓÚ¹¤×÷ÉϵÄÐèÒª£¬×î½ü»¹ÊÇ»ØÍ·¿´ÁËһϼ´½«ÍƳöµÄASP.NET Ajax Library...£¬Ë³±ãÕÒÁËÒ»ÏÂÍøÂçÉϵÄѶϢ£¬¿´Õâ¸öÌ¬ÊÆÎÒ²ÂÏëÓ¦¸Ã²»ÉÙASP.NET¿ª·¢ÈËÔ±ºöÂÔµôÁËÕâ¸öÆäʵÒѾbet ......
±í¼ò½à
"¹«½»Ïß·Êý¾Ý¿â"
ÓõÄsqlÊý¾Ý¿â
admin±í
username
password
admin
admin
busroute ±í
³µ´Î
stop-name-id
Õ¾´Î
Ʊ¼Û
68
4
1
1
34
5
6
1.5
25
6
3
2
Õ¾µã±í
id
stop-name
1
»ð³µÕ¾
³µ´Î±í
id
³µ´Î
1
1
Èç¹ûÒªÓûùÓÚvb.netµÄasp.net±à³Ì
µÇ½µÄʱºò¸ÃÔõô±à³Ì°¡,Êý¾Ý¿âÊÇÓÃsql× ......
ÔÒò¾ÍÊÇIISºÍ.net Framework2.0°²×°Ë³Ðò·´ÁË£¬ÒòΪÎÒÏÈÇ°Ôø¾×°¹ýVisualStudio2005£¬ËùÒÔϵͳÀïÏȰ²×°ÁË.net Framework2.0£¬¶øÕâÑùºóÀ´×°¹ýIISºó£¬.net Frameworkδע²áÏà¹Ø×é¼þ£¬²»ÄܶÔIIS×ö³öÐ޸ģ¬¾Í»á³öÏÖÕâÖÖÇé¿ö£¡
½â¾ö·½·¨£º
µ½C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727ÖÐÕÒ£¬Óиö¹¤¾ß½Ð aspnet_regiis.exe ......
½ñÌìÑо¿ÁËÒ»ÏÂÔÚasp.netÏÂÓÃC#ÓïÑÔѹËõÎļþ£¬ºÍ½âѹÎļþ£¬ÔÚÍøÉϺÃÁ˺þòÅÕÒµ½Ô´´úÂ룬£¬Õæ²»ÈÝÒ×°¡£¡£¡
ÔÚ ASP.NET ÖÐÓÐÁ½¸öÀࣺDeflateStream ºÍ GZipStream ÓÃÓÚ´¦ÀíѹËõºÍ½âѹËõ£¬ÕâÁ½¸öÀà·Ö±ðʹÓõÄÊÇ DEFLATE ºÍ gzip ѹËõËã·¨£¬ÕâÁ½¸öËã·¨±»Ò»Ð©Ñ¹ËõÈí¼þÖ§³Ö£¬±ÈÈç WinRAR ¾ÍÖ§³Ö gzip¡£ÕâÁ½¸öÀàµÄÃû³Æ¿Õ¼ä¾ùΪ£ ......
ÎÒÃÇÔÚASP.NET³ÌÐòµÄ¿ª·¢¹ý³ÌÖУ¬³£³£ÐèÒªÏòÓû§¸ø³öÌáʾÐÅÏ¢£¬±ÈÈçÊÇ·ñ“²Ù×÷³É¹¦”£¬“È·¶¨”»¹ÊǓȡÏû”²Ù×÷¡£
(1) µã»÷Ò³ÃæÉϵİ´Å¥£¬µ¯³öÒ»¸ö¶Ô»°¿òÌáʾÊǓȷ¶¨”»¹ÊǓȡÏû”²Ù×÷£¬ÎÒÃDzÉÓÃÔÚ°´Å¥ÖÐÌí¼ÓÊôÐÔÀ´Íê³É£º
......