亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        在asp.net中使用加密數(shù)據(jù)庫聯(lián)接字符串保證數(shù)據(jù)安全

        字號:


            在我們發(fā)布網(wǎng)站時,加密web.config,這樣可以有效保證數(shù)據(jù)庫用戶和密碼安全,其步驟如下:
            1.添加密鑰
            執(zhí)行:c:windowsmicrosoft.netframeworkv2.0.50727aspnet_regiis -pc hnlaw -exp
            其中hnlaw為密鑰名稱
            2.添加web.config節(jié)點
            在web.config的<configuration></configuration>之間添加:
            <configprotecteddata>
            <providers>
            <add keycontainername=hnlaw usemachinecontainer=true description=uses rsacryptoserviceprovider to encrypt and
            decrypt name=hnlaw type=system.configuration.rsaprotectedconfigurationprovider,system.configuration, version=2.0.0.0,
            culture=neutral, publickeytoken=b03f5f7f11d50a3a />
            </providers>
            </configprotecteddata>
            注意:這里keycontainername=hnlaw和name=hnlaw分別表示你的密鑰名稱;
            3.加密web.config
            到網(wǎng)站根目錄添加一個批處理文件enweb.bat,內(nèi)容如下:
            代碼如下:
            @echo off
            c:windowsmicrosoft.netframeworkv2.0.50727aspnet_regiis -pef system.web/identity e:hs studiodonet2hnlawyer -prov
            hnlaw
            c:windowsmicrosoft.netframeworkv2.0.50727aspnet_regiis -pef connectionstrings e:hs studiodonet2hnlawyer -prov
            hnlaw
            pause
            注冊上面的的路徑和名稱!
            運行后出現(xiàn)成功!
            4.解密
            同樣到網(wǎng)站根目錄添加一個批處理文件deweb.bat,內(nèi)容如下:
            代碼如下:
            @echo off
            c:windowsmicrosoft.netframeworkv2.0.50727aspnet_regiis -pef system.web/identity e:hs studiodonet2hnlawyer
            c:windowsmicrosoft.netframeworkv2.0.50727aspnet_regiis -pdf connectionstrings e:hs studiodonet2hnlawyer
            pause
            最后就是要注意:做完后找到c:documents and settingsall usersapplication datamicrosoftcryptorsamachinekeys目錄下,找到生成
            的密鑰文件(可按時間查找),給上network service可讀取權限,不然會出現(xiàn)error message from the provider: the rsa key container could
            not be opened.
            無法讀取
            這樣可能會出現(xiàn),如果沒有自己的服務器,沒有權限修改machinekeys目錄,不知道還有其它解決辦法,希望大家共享一下 :)