ASP.NET C# URL¼ÓÃܽâÃÜ
using System.Security.Cryptography;
using System.IO;
using System.text;
/// <summary>
/// ¼ÓÃÜ
/// </summary>
/// <param name="str"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string Encode(string str, string key)
{
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
provider.Key = Encoding.ASCII.GetBytes(key.Substring(0, 8));
provider.IV = Encoding.ASCII.GetBytes(key.Substring(0, 8));
byte[] bytes = Encoding.GetEncoding("GB2312").GetBytes(str);
MemoryStream stream = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream, provider.CreateEncryptor(), CryptoStreamMode.Write);
stream2.Write(bytes, 0, bytes.Length);
stream2.FlushFinalBlock();
StringBuilder builder = new StringBuilder();
foreach (byte num in stream.ToArray())
Ïà¹ØÎĵµ£º
ASP.NET µÄ»º´æ»úÖÆÏà±ÈASPÓкܴóµÄ¸Ä½ø£¬±¾Îĵµ³ý¶Ô³£ÓÃÓÅ»¯·½·¨½øÐÐ×ܽá½éÉÜÍ⣬ǿµ÷ÁËÈçºÎʹÓÃASP.NETµÄ»º´æÀ´»ñµÃ×î¼ÑÐÔÄÜ¡£
1£º²»ÒªÊ¹Óò»±ØÒªµÄsession
ºÍASPÖÐÒ»Ñù£¬ÔÚ²»±ØÒªµÄʱºò²»ÒªÊ¹ÓÃSession¡£
¿ÉÒÔÕë¶ÔÕû¸öÓ¦ÓóÌÐò»òÕßÒ³Ãæ½ûÓûỰ״̬£º
l ½ûÓÃÒ³ÃæµÄ ......
ºÜ¶àÈ˶¼ÏòÔÚ·þÎñÆ÷
¶Ëµ÷Óÿͻ§¶ËµÄº¯ÊýÀ´²Ù×÷£¬Ò²¾ÍÊÇÔÚaspÖе÷ÓÃjava
script½Å±¾ÖÐÒѾ¶¨ÒåºÃµÄ½Å±¾º¯Êý¡£¾¹ýÑо¿£¬·¢ÏÖÁËһЩÃãÇ¿µÄ·½·¨¡£
1.
ÓÃResponse.Write·½·¨Ð´Èë½Å±¾
±ÈÈçÔÚÄãµ¥»÷°´Å¥ºó£¬ÏȲÙ×÷Êý¾Ý¿â
£¬ÍêÁ˺óÏÔʾÒѾÍê³É£¬¿ÉÒÔÔÚ×îºóÏëµ÷Óõĵط½Ð´ÉÏ
Response.Write("<script type='text/j ......
1.°²×°ºó
°²×°ÍêMVCºó,VSµÄWEBÏîÄ¿Àï»á³öÏÖÁ½¸öеÄÄ£°æ:
a. ASP.NET MVC 2 WEB Application ʹÓÃÕâ¸öÄ£°å»á¶àÉú³ÉÒ»¸öNUNIT²âÊÔÏîÄ ......
ÔÚ¿ª·¢¹ý³ÌÖУ¬Í¨¹ýÃþË÷²é×ÊÁÏ£¬ÊÕ¼¯ÁËһЩֵµÃÌá³öÀ´µÄ¾Ñ飺
1¡¢ Ïà¶ÔÓÚÔÀ´µÄforÓï¾äforeach¾ßÓиüºÃµÄÖ´ÐÐЧÂÊ£¬foreachµÄƽ¾ù»¨·Ñʱ¼äÖ»ÓÐforµÄ30%¡£Í¨¹ý²âÊÔ½á¹ûÔÚforºÍforeach¶¼¿ÉÒÔʹÓõÄÇé¿öÏ£¬ÎÒÃÇÍÆ¼öʹÓÃЧÂʸü¸ßµÄforeach¡£ÁíÍ⣬ÓÃforдÈëÊý¾Ýʱ¼ä´óÔ¼ÊǶÁÈ¡Êý¾Ýʱ¼äµÄ10±¶×óÓÒ£»
2¡¢ ÔÚasp.net³ÌÐòÖУ¬ ......
1.<asp:Button ID="btnSumbit" runat="server" UseSubmitBehavior="false" OnClientClick="this.value='Sumbit';this.disabled=true; " Text="Sumbit" OnClick="btnSumbit_Click" />
2.¶Ô“Ìí¼Ó”¡¢“Ìá½»”¡¢“±£´æ”¡¢“¸üДµÈ°´Å¥ÐèÒª¶ÔÊý¾Ý¿â½øÐÐд²Ù×÷µÄ°´Å¥£¬Ò»¶¨Ò ......