我的网站c#asp.net和SQLite。在主要的圆顶www。我的网站。 com在web.config中工作正常......
<connectionStrings>
<add name="SQLiteConnector" connectionString="Data Source=|DataDirectory|MyBase.db3;"
providerName="System.Data.SQLite"/>
</connectionStrings>
MyBase.db3位于App_Data文件夹中。 现在我在域www中有网站。 NewSubdomain。 MySite .com 并且不知道如何在主要的地方www.MySite.com建立连接基地 我必须在web.config中放置什么?我还需要更多东西或者连接吗? HELP !!!
答案 0 :(得分:0)
由于web.config文件对于所有站点都是通用的,因此您可以为每个子域添加这样的多个连接字符串:
<connectionStrings>
<add connectionString="" name="subdomain1"/>
<add connectionString="" name="subdomain2"/>
</connectionStrings>
然后您可以使用
检查当前网址HttpContext.Current.Request.Url.AbsoluteUri