private static System.Configuration.Configuration OpenWebConfigurationImpl(WebLevel webLevel, ConfigurationFileMap fileMap, string path, string site, string locationSubPath, string server, string userName, string password, IntPtr userToken)
        {
            VirtualPath path2;

            if (HostingEnvironment.IsHosted)
            {
                path2 = VirtualPath.CreateNonRelativeAllowNull(path);
            }
            else
            {
                path2 = VirtualPath.CreateAbsoluteAllowNull(path);
            }
            return(WebConfigurationHost.OpenConfiguration(webLevel, fileMap, path2, site, locationSubPath, server, userName, password, userToken));
        }
예제 #2
0
        //
        // *************************************************
        // ** Static Management Functions to edit config **
        // *************************************************
        //

        private static Configuration OpenWebConfigurationImpl(
            WebLevel webLevel, ConfigurationFileMap fileMap, string path, string site, string locationSubPath,
            string server, string userName, string password, IntPtr userToken)
        {
            // In the hosted case, we allow app relative (~/....).  Otherwise, it must be absolute
            VirtualPath virtualPath;

            if (HostingEnvironment.IsHosted)
            {
                virtualPath = VirtualPath.CreateNonRelativeAllowNull(path);
            }
            else
            {
                virtualPath = VirtualPath.CreateAbsoluteAllowNull(path);
            }

            return(WebConfigurationHost.OpenConfiguration(webLevel, fileMap, virtualPath, site, locationSubPath,
                                                          server, userName, password, userToken));
        }