加载web.config文件 [英] Loading web.config file

查看:84
本文介绍了加载web.config文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想要的是一个应用程序可以具有多个web.config.

假设印度的配置文件
德国的配置文件.

这样.
假设印度人登录印度配置文件应加载
并且如果德国人登录德国配置文件应该加载

这可能吗

请帮助

Hi there,

what i want is a application can have multiple web.config.

suppose a config file for INDIA
a config file for Germany.

like that.
suppose india person logs in India config file should load
and if german person logs in Germany config file should load

is this possible

please help

推荐答案

保留明智的文件夹并将您的配置文件放在其中,然后调用..
Keep contry wise folders and put your config files in that and call upon so..


提到
THEY WILL HAVE DIFFERENT DATABASE CONNECTION IN CONNECTIONSTRING WITH SIMILAR NAME


您可以通过将连接字符串放在资源文件而不是web.config中来实现.资源文件将根据区域性加载,您可以从资源文件中读取相应的连接字符串.

[edit]

您将必须创建一个全局资源文件.有关用法部分,请参阅以下文章.
http://msdn.microsoft.com/en-us/library/ms227427.aspx [ ^ ]
在ASP.NET中使用全球化和本地化 [ ^ ]


You can achieve that by putting the connectionstring in the resource file rather than web.config. the resource file will be loaded based on the culture and you can read the respective connectionstring from the resource file.

[edit]

You will have to create a global resource file. refer to following articles for the usage part.
http://msdn.microsoft.com/en-us/library/ms227427.aspx[^]
Using Globalization and Localization in ASP.NET[^]


是的,
您的项目中可以有多个web.config文件.
但是在根文件夹中,您必须仅拥有一个文件夹,然后根据国家/地区创建目录,并在特定目录中添加另一个web.config文件.

对于根据身份验证规则用于登录的人.请查看此示例.
使用多个Web.config文件 [ ^ ]
yes it is possible,
That you can have multiple web.config file in your project.
But in root folder you must have it only one and then create directories as per country and add another web.config file in particular directory.

And for peoples who are used it to login based on Authentication rule.Please look into this example.
Working with more than one Web.config file[^]


这篇关于加载web.config文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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