我想在我的dll中存储连接字符串。我创建了一个类库来存储连接字符串。如何将此连接字符串值传递给web.config文件?或者如何在另一个项目中获得这个值?
public class Class1
{
public string encrypt()
{
string connection = @"Server=SYSTEM-6\SQLEXPRESS;Database=devleadsdb;Integrated Security=True;";
return connection;
}
}发布于 2015-08-08 19:16:48
您可以使用类库嵌入加密和解密算法。然后使用该类读取加密的连接字符串,并将其写入connectionStrings /app.config上的app.configXML部分。将该库引用到您的主项目。
https://stackoverflow.com/questions/31891212
复制相似问题