本文整理汇总了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");
示例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;
}