Dim a As String = Request.Url.Host.ToString() If Request.Url.Host.Contains("tes1.com") Then Try Me.MasterPageFile = "~/TestLogo1.master" ' Set the root path of the Web application that contains the ' Web.config file that you want to access. ' Get the configuration object to access the related Web.config file. Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~/Web2.config") ' Get the object related to the <appsettings> section. Dim section As AppSettingsSection = DirectCast(config.GetSection("appSettings"), AppSettingsSection) ' Read the <appsettings> section. 'StringBuilder appSettings = new StringBuilder(); 'appSettings.Append("WebConfig1"); 'appSettings.Append(section.Settings["WebConfig1"].ToString()); Dim SettingValue As String = section.Settings("WebConfig2").Value ' Display the <appsettings> information. 'ConfigId.Text = appSettings.ToString(); Response.Write(SettingValue) Catch ex As Exception Response.Write(ex) End Try</appsettings></appsettings></appsettings>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)