首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

VS2012 C# WindowsForm 连接 数据库,帐号密码等怎么加密

2013-04-02 
VS2012 C# WindowsForm 连接 数据库,帐号密码等如何加密?string conStr server.databaseTicketManag

VS2012 C# WindowsForm 连接 数据库,帐号密码等如何加密?
string conStr = "server=.;database=TicketManager;Uid=sa;pwd=tcaccp;";
SqlConnection con = new SqlConnection(conStr);

平时大家都习惯是这样内置连接数据库的: Uid , pwd 等信息,
但 C# (Exe) 不是很容易给破解和查看么?

那这样不是很容易给泄露了???

大家平时是如何防范的???

谢说二句,谢谢! 数据库 c# database string
[解决办法]
"server=.;database=TicketManager;Uid=sa;pwd=tcaccp;" 可以加密后放在xml 程序读取、解密
[解决办法]
exe 文件 可以加壳
[解决办法]
可以把server=.;database=TicketManager;Uid=sa;pwd=tcaccp;";
先加密,读的时候解密
[解决办法]
xml加密,然后解密。用这种方式读取app.config就可以实现。



                ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
                fileMap.ExeConfigFilename = file_name;
                // relative path names possible

                Configuration config =
                   ConfigurationManager.OpenMappedExeConfiguration(fileMap,
                   ConfigurationUserLevel.None);

                AppSettingsSection appSettings = (AppSettingsSection)config.GetSection("appSettings");

                .....

                ret_value = StaticDES.EncryptDecrypt.DecryptDES(node_value);

热点排行