dzÎöASP.NETÉú³ÉËæ»úÃÜÂë
ASP.NETÉú³ÉËæ»úÃÜÂë
ÔÚ¿ª·¢ÐèÒªÓû§×¢²áºó²ÅÄÜʹÓÃÌṩµÄ¸÷ÏÄܵÄÓ¦ÓóÌÐòʱ£¬ÔÚÐÂÓû§Ìá½»×¢²áÐÅÏ¢ºó£¬½Ï³£¼ûµÄ×ö·¨ÊÇÓɳÌÐòÉú³ÉËæ»úÃÜÂ룬Ȼºó·¢ËÍÃÜÂëµ½Óû§×¢²áʱÌîдµÄµç×ÓÐÅÏ䣬Óû§ÔÙÓÃÊÕµ½µÄÃÜÂëÀ´¼¤»îÆäÕÊ»§¡£
ʵÏÖASP.NETÉú³ÉËæ»úÃÜÂ빦ÄÜÊǺÜÈÝÒ׵ģ¬ÏÂÃæµÄ´úÂë¸ø³öÁËÍêÕûµÄʵÏÖ·½·¨£º
publicstaticstringMakePassword(stringpwdchars,intpwdlen)
{
stringtmpstr="";
intiRandNum;
Randomrnd=newRandom();
for(inti=0; i{
iRandNum=rnd.Next(pwdchars.Length);
tmpstr+=pwdchars[iRandNum];
}
returntmpstr;
} ¶ÔÕÕÔ´Â룬½²Ò»Ï¾ßÌåµÄ˼·£º
·½·¨ MakePassword ½ÓÊÜÁ½¸ö²ÎÊý£¬pwdchars ²ÎÊýÖ¸¶¨Éú³ÉµÄËæ»úÃÜÂë´®¿ÉÒÔʹÓÃÄÄЩ×Ö·û£¬pwdlen Ö¸¶¨Éú³ÉµÄËæ»úÃÜÂë´®µÄ³¤¶È¡£ÓÐÁËÕâÁ½¸ö²ÎÊý£¬Í¨¹ýµ÷Óà Random ÀàµÄ Next() ·½·¨£¬ÏÈ»ñµÃÒ»¸ö´óÓÚ»òµÈÓÚ 0 ¶øСÓÚ pwdchars ³¤¶ÈµÄÕûÊý£¬ÒÔ¸ÃÊý×÷ΪË÷ÒýÖµ£¬´Ó¿ÉÓÃ×Ö·û´®ÖÐËæ»úÈ¡×Ö·û£¬ÒÔÖ¸¶¨µÄÃÜÂ볤¶ÈΪѻ·´ÎÊý£¬ÒÀ´ÎÁ¬½ÓÈ¡µÃµÄ×Ö·û£¬×îºó¼´µÃµ½ËùÐèµÄËæ»úÃÜÂë´®ÁË¡£
´úÂëµ÷Óà MakePassword() ·½·¨»ñÈ¡³¤¶ÈΪ 10 £¬¿ÉÓÃ×Ö·û·¶Î§Îª´óСд×Öĸ¼°Êý×ÖµÄËæ»ú×Ö·û´®¡£
string randomchars ="abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string password = MakePassword(randomchars, 10); ÒÔÉÏÊÇASP.NETÉú³ÉËæ»úÃÜÂë¡£
Ïà¹ØÎĵµ£º
ÔÚ½« ASP.NET Web ²¿¼þµÄ¼¯³É¿Ø¼þ¼¯ÖеĿؼþ°üÀ¨ÔÚÍøÒ³ÖÐʱ£¬ÕâЩ¿Ø¼þ½«×ñÊظÃÒ³µÄ¹æÔò£»¾ßÌå¶øÑÔ¾ÍÊÇ£¬ÕâЩ¿Ø¼þ½«ÔÚ¸ÃÒ³µÄÉúÃüÖÜÆÚÄÚÔËÐС£
ÿ¸öÍøÒ³¶¼¾ßÓÐÒ»¸öÉúÃüÖÜÆÚ£¬ÍøÒ³ÔÚÆäÉúÃüÖÜÆÚÄÚ½«Ö´ÐÐһϵÁд¦Àí²½Öè¡£ÕâЩ²½Öè°üÀ¨³õʼ»¯¡¢´´½¨¿Ø¼þ¡¢»¹ÔºÍά»¤×´Ì¬¡¢ÔËÐÐʼþ´¦Àí³ÌÐò´ú ......
ASP.NET Web ²¿¼þ¿Ø¼þ¼¯ÊÇÒ»×éÐͬ¹¤×÷µÄ×é¼þ£¬Ê¹Äú¿ÉÒÔ´´½¨×îÖÕÓû§¿ÉÒÔÖ±½Ó´Óä¯ÀÀÆ÷ÐÞ¸ÄÆäÓû§½çÃæ (UI) µÄÍâ¹ÛºÍÐÐΪµÄÍøÒ³¡£±¾¸ÅÊöº¸ÇÁË Web ²¿¼þ¿Ø¼þ¼¯µÄ»ù±¾·½Ã棬°üÀ¨×î³£ÓõĿؼþÒÔ¼°´´½¨ Web ²¿¼þÒ³ËùÐèµÄ»ù±¾ Web ²¿¼þ×é¼þµÄ˵Ã÷¡£
Ò»¡¢Web ²¿¼þ×é¼þµÄÀà±ð
Web ²¿¼þ¿Ø¼þ¼¯Ó ......
ImportCatalogPart Web ·þÎñÆ÷¿Ø¼þ¿Éµ¼Èë WebPart ¿Ø¼þµÄ˵Ã÷Îļþ£¨»òÓÃ×÷ WebPart ¿Ø¼þµÄÆäËû ASP.NET ·þÎñÆ÷¿Ø¼þ£©¡£ÕâÑù¾Í¿ÉÒÔ½«¸Ã¿Ø¼þͨ¹ýÔ¤ÏÈÖ¸¶¨µÄÉèÖÃÌí¼Óµ½ÍøÒ³ÖС£¸Ã˵Ã÷ÎļþʹÓû§¿ÉÒÔ¹²Ïí WebPart ¿Ø¼þµÄÉèÖá£
˵Ã÷ÎļþÓë¿Ø¼þ±¾Éí²»Í¬¡£ËüÊÇÒÔ .WebPart ÎļþÀ©Õ¹Ãû½áβµÄ XM ......
ÏÈ¿´¿´ASP.NETÒ³ÃæˢеÄʵÏÖ·½·¨£º
µÚÒ»£º
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } µÚ¶þ£º
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.locatio ......
CheckBoxÑ¡Ôñ×é¼þÊÇÒ»¸ö³ÌÐòÖж¼¾³£µÄ×é¼þ¡£ÔÚ³ÌÐòÉè¼ÆÖÐʹÓõ½¸Ã×é¼þ£¬Ò»°ã¶¼²»»áֻʹÓõ½Ò»¸ö£¬ÍùÍùÊÇÒÔ¶à¸ö´ËÀà×é¼þµÄÐÎʽ³öÏֵġ£ÔÚASP.NETÒ³ÃæÖÐÈç¹ûҪʹÓõ½¶à¸öCheckBox×é¼þ£¬³ýÁËÌí¼Ó¶à¸öCheckBox×é¼þÔÚÒ³ÃæÖÐÖ®Í⣬»¹ÓÐÒ»ÖֱȽϷ½±ãµÄ·½·¨£¬¾ÍÊÇʹÓÃCheckBoxList ×é¼þ¡£CheckBoxList×é¼þÊÇÓÉÒ»×éµÄCheckBox×é¼þ×é ......