<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        asp.net 字符串加密解密技術

        來源:懂視網 責編:小采 時間:2020-11-27 22:44:30
        文檔

        asp.net 字符串加密解密技術

        asp.net 字符串加密解密技術: 代碼如下:using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI
        推薦度:
        導讀asp.net 字符串加密解密技術: 代碼如下:using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI

        代碼如下:
        using System;
        using System.Data;
        using System.Configuration;
        using System.Collections;
        using System.Web;
        using System.Web.Security;
        using System.Web.UI;
        using System.Web.UI.WebControls;
        using System.Web.UI.WebControls.WebParts;
        using System.Web.UI.HtmlControls;
        using System.Text;
        using System.Security.Cryptography;
        using System.IO;
        namespace www
        {
        public partial class jiami : System.Web.UI.Page
        {
        protected void Page_Load(object sender, EventArgs e)
        {
        Bind();
        }
        private void Bind()
        {
        //加密
        this.Title = DesEncrypt("pwd", "abcd1234");
        this.Title += DesDecrypt(this.Title, "abcd1234");
        Response.Write(DesDecrypt("2ikCw0TqKGo=", "abcd1234"));
        }
        /// <summary>
        /// 加密字符串
        /// 注意:密鑰必須為8位
        /// </summary>
        /// <param name="strText">字符串</param>
        /// <param name="encryptKey">密鑰</param>
        /// <param name="encryptKey">返回加密后的字符串</param>
        public string DesEncrypt(string inputString, string encryptKey)
        {
        byte[] byKey = null;
        byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
        try
        {
        byKey = System.Text.Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8));
        DESCryptoServiceProvider des = new DESCryptoServiceProvider();
        byte[] inputByteArray = Encoding.UTF8.GetBytes(inputString);
        MemoryStream ms = new MemoryStream();
        CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(byKey, IV), CryptoStreamMode.Write);
        cs.Write(inputByteArray, 0, inputByteArray.Length);
        cs.FlushFinalBlock();
        return Convert.ToBase64String(ms.ToArray());
        }
        catch (System.Exception error)
        {
        //return error.Message;
        return null;
        }
        }
        /// <summary>
        /// 解密字符串
        /// </summary>
        /// <param name="this.inputString">加了密的字符串</param>
        /// <param name="decryptKey">密鑰</param>
        /// <param name="decryptKey">返回解密后的字符串</param>
        public string DesDecrypt(string inputString, string decryptKey)
        {
        byte[] byKey = null;
        byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
        byte[] inputByteArray = new Byte[inputString.Length];
        try
        {
        byKey = System.Text.Encoding.UTF8.GetBytes(decryptKey.Substring(0, 8));
        DESCryptoServiceProvider des = new DESCryptoServiceProvider();
        inputByteArray = Convert.FromBase64String(inputString);
        MemoryStream ms = new MemoryStream();
        CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write);
        cs.Write(inputByteArray, 0, inputByteArray.Length);
        cs.FlushFinalBlock();
        System.Text.Encoding encoding = new System.Text.UTF8Encoding();
        return encoding.GetString(ms.ToArray());
        }
        catch (System.Exception error)
        {
        //return error.Message;
        return null;
        }
        }
        }
        }

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        asp.net 字符串加密解密技術

        asp.net 字符串加密解密技術: 代碼如下:using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI
        推薦度:
        標簽: 加密 技術 解密
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲国产精品成人综合色在线| 久久精品国产亚洲AV嫖农村妇女| 亚洲免费在线观看视频| 嫩草影院在线播放www免费观看| 亚洲欧洲自拍拍偷精品 美利坚 | 国产大片91精品免费看3| 亚洲五月丁香综合视频| AV免费网址在线观看| 亚洲日韩AV无码一区二区三区人 | 国产男女猛烈无遮挡免费视频 | 深夜福利在线视频免费| 亚洲A丁香五香天堂网| 一级毛片a女人刺激视频免费| 亚洲国产综合无码一区二区二三区| 美女被爆羞羞网站在免费观看| 亚洲黄黄黄网站在线观看| 久久久久女教师免费一区| 亚洲AV日韩AV天堂一区二区三区| 无码成A毛片免费| 亚洲一级黄色大片| 日本免费的一级v一片| 色多多www视频在线观看免费| 亚洲熟妇av一区二区三区| 99视频免费播放| 亚洲人AV在线无码影院观看| 亚洲成a人片在线观看日本麻豆| 国产大片免费天天看| 亚洲精品在线免费观看视频| 成人免费视频小说| 一级中文字幕乱码免费| 亚洲综合一区二区国产精品| 夭天干天天做天天免费看| 污视频网站免费观看| 亚洲av永久无码制服河南实里 | 国产av无码专区亚洲国产精品| 日本亚洲欧洲免费天堂午夜看片女人员| 亚洲av极品无码专区在线观看| 国产小视频在线免费| 成全视频高清免费观看电视剧| 亚洲va在线va天堂va手机| 免费大黄网站在线看|