如何在dll / class库中存储连接字符串

时间:2015-08-08 08:30:22

标签: c# asp.net web-config

我想在我的dll中存储一个连接字符串。我创建了一个类库来存储连接字符串。如何将此连接字符串值传递给public static void main(String[] args) { // TODO Auto-generated method stub Player barca[] = new Player[10]; Player barca2[] = new Player[10]; for(int i=0; i<10; i++){ barca[i] = new Player(); barca[i].id = i; } barca2 = barca; //print the arrays for(int i = 0; i<10; i++){ System.out.print(barca[i].id); } System.out.println(); for(int i = 0; i<10; i++){ System.out.print(barca2[i].id); } //change an array barca2[5].id=100; System.out.println(); //print the arrays for(int i = 0; i<10; i++){ System.out.print(barca[i].id); } System.out.println(); for(int i = 0; i<10; i++){ System.out.print(barca2[i].id); } } 文件?或者如何在另一个项目中获得此值?

web.config

1 个答案:

答案 0 :(得分:0)

您可以使用类库来嵌入加密和解密算法。然后使用该类在web / app.config上读取和写入加密连接字符串到connectionStrings xml部分。请将此库引用到您的主项目。

相关问题