本帖最后由 ynbean 于 2011-08-05 13:11:26 编辑

解决方案 »

  1.   

    干预VS估计比较难你可以写个加解密的方法,读取SQL连接字符串的时候先读取你定义的方法
      

  2.   

    请问知道怎么修改xml么?大同小异,好好想想.
      

  3.   

    这篇文章是为你量身定制的
     what about the people like me that do not want my users to access that database? I don’t want them to have that username and password…
    :)TableAdapter Connection Strings
    http://thecodemonk.com/2008/02/18/tableadapter-connection-strings/
      

  4.   


     public static void SetConfig(string key, string value)
            {
                Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);            if (config.AppSettings.Settings[key] != null)
                    config.AppSettings.Settings[key].Value = value;
                else
                    config.AppSettings.Settings.Add(key, value);            config.Save(ConfigurationSaveMode.Modified);
                ConfigurationManager.RefreshSection("appSettings");
            }
    写appsettings的方法,release模式有效.
      

  5.   

    4楼的思路very good, 我不一定照着它做,但它提供了思路。
    5楼的代码有一定参考价值。
    结帖了,感谢所有人!