当前位置: 首页>>代码示例>>C#>>正文


C# Config.getConfigXml方法代码示例

本文整理汇总了C#中Config.getConfigXml方法的典型用法代码示例。如果您正苦于以下问题:C# Config.getConfigXml方法的具体用法?C# Config.getConfigXml怎么用?C# Config.getConfigXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Config的用法示例。


在下文中一共展示了Config.getConfigXml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateOutput


//.........这里部分代码省略.........

            string edition = null;
            //Pick the largest edition
            foreach (string s in new string[] { "R3Elite", "R3Creative", "R3Performance" })
            {
                if (new List<string>(editionsUsed.Values).Contains(s))
                {
                    edition = s;
                    break;
                }
            }

            Dictionary<string, string> friendlyNames = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
            friendlyNames.Add("R3Elite", "Elite Edition or Support Contract");
            friendlyNames.Add("R3Creative", "Creative Edition");
            friendlyNames.Add("R3Performance", "Performance Edition");

            if (edition == null)
                sb.AppendLine("\nYou are not using any paid plugins.");
            else {
                sb.Append("\nYou are using plugins from the " + friendlyNames[edition] + ": ");
                foreach (string s in editionsUsed.Keys) sb.Append(s + " (" +  friendlyNames[editionsUsed[s]] + "), ");
                sb.Remove(sb.Length - 2, 2);
                sb.AppendLine();
            }

            sb.AppendLine("\nRegistered plugins:\n");
            foreach (IPlugin p in c.Plugins.AllPlugins)
                sb.AppendLine(p.ToString());

            sb.AppendLine("\nConfiguration:\n");

            //Let plugins redact sensitive information from the configuration before we display it
            Node n = c.getConfigXml();
            foreach (IRedactDiagnostics d in c.Plugins.GetAll<IRedactDiagnostics>())
                n = d.RedactFrom(n);

            string config = n.ToString();
            string pwd = c.get("remoteReader.signingKey", String.Empty);
            if (!string.IsNullOrEmpty(pwd)) config.Replace(pwd,"*********");
            sb.AppendLine(config);

            sb.AppendLine("\nAccepted querystring keys:\n");
            foreach (string s in c.Pipeline.SupportedQuerystringKeys) {
                sb.Append(s + ", ");
            }
            sb.AppendLine();

            sb.AppendLine("\nAccepted file extensions:\n");
            foreach (string s in c.Pipeline.AcceptedImageExtensions) {
                sb.Append(s + ", ");
            }
            sb.AppendLine();

            //Echo server assembly, iis version, OS version, and CLR version.
            sb.AppendLine("\nEnvironment information:\n");
            string iis = context != null ? context.Request.ServerVariables["SERVER_SOFTWARE"] : "NOT ASP.NET";
            if (!string.IsNullOrEmpty(iis)) iis += " on ";
            sb.AppendLine("Running " + iis +
                System.Environment.OSVersion.ToString() + " and CLR " +
                System.Environment.Version.ToString());
            sb.AppendLine("Trust level: " + GetCurrentTrustLevel().ToString());

            try{
                string wow64 = System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432");
                string arch = System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
开发者ID:stukalin,项目名称:ImageResizer,代码行数:67,代码来源:DiagnosticPageHandler.cs

示例2: Install

 public IPlugin Install(Configuration.Config c)
 {
     this.c = c;
     c.Plugins.add_plugin(this);
     ParseXml(c.getConfigXml().queryFirst("presets"),c);
     c.Pipeline.RewriteDefaults += Pipeline_RewriteDefaults;
     c.Pipeline.Rewrite += Pipeline_Rewrite;
     c.Pipeline.PostRewrite += Pipeline_PostRewrite;
     return this;
 }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:10,代码来源:Presets.cs


注:本文中的Config.getConfigXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。