我们可以将连接字符串存储在machine.config中吗? [英] Can we store Connection string in machine.config?

查看:84
本文介绍了我们可以将连接字符串存储在machine.config中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在.net

推荐答案

是的,可以在machine.config中存储连接字符串.但这不是一个好主意.所有应用程序都使用Machine.config,即使那些不应该访问您的连接字符串的应用程序也是如此.通常,连接字符串仅适用于一个应用程序,应存储在该应用程序的配置文件中.
Yes, you can. But it is not a good idea to do so. Machine.config is used by all applications, even ones that should not have access to your connection string. Generally connection strings only apply to one application and should be stored in the config file for that application.


这篇关于我们可以将连接字符串存储在machine.config中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆