c#.net问题.大家帮忙 使用c#.net 读取服务器上USB 序号 以保证一个web程序只能用于一个机器. 我把连接数据库的地址写在了webconfig里, 这样他们就能看见连接SQL 帐号和密码了, 去SQL里自己该 USB 序列号. 我应该怎么做. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 加密web.config中的连接字符串使用的时候再解密des 修改config文件System.Web.Configuration.WebConfigurationManager.OpenWebConfigurationdes,md5等加密用户名密码,获取解密加密连接字符串FileInfo fileinfo = new FileInfo(Context.Parameters["targetdir"] + "\\web.config"); XmlDocument xmldocument=new XmlDocument(); xmldocument.Load(fileinfo.FullName); foreach(XmlNode node in xmldocument.SelectSingleNode("appSettings").ChildNodes) { if (node.Name == "add") { if (node.Attributes.GetNamedItem("key").Value == "connString") { node.Attributes.GetNamedItem("value").Value= "'; } } } xmldocument.Save(fileinfo.FullName); log4net问题。。 有个小问题,熟手过来帮忙看看~~~~~~~~~~ asp.net 读注册表 新手求一算法,300分 怎样在asp.net 中实现幻灯片的效果?.......在线等! 问个datagrid分页显示后的问题 insert into每次都重复插入数据 ==asp.net网站出现严重错误!!!高手帮忙 Session超时了,我应该如何修改WEB.Config来改变超时的时间限制!!在线等待!! 文件上传的问题 sql 语句怎么写!!!! form里面两个asp:Button,怎么控制让谁优先?
使用的时候再解密des
des,md5等加密用户名密码,获取解密
加密连接字符串
FileInfo fileinfo = new FileInfo(Context.Parameters["targetdir"] + "\\web.config");
XmlDocument xmldocument=new XmlDocument();
xmldocument.Load(fileinfo.FullName);
foreach(XmlNode node in xmldocument.SelectSingleNode("appSettings").ChildNodes)
{
if (node.Name == "add")
{
if (node.Attributes.GetNamedItem("key").Value == "connString")
{
node.Attributes.GetNamedItem("value").Value= "';
}
}
}
xmldocument.Save(fileinfo.FullName);