private static string GetFlexAdditionalJarFilesInfo(bool isCheckBoxDisabled) { StringBuilder output = new StringBuilder(); try { string jars = ini.GetSetting("JAR_FILES", "Items", ""); if (jars != "" && jars != null) { char[] charSeparators = new char[] { ';' }; string[] jarItems = jars.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); int indentLevel = 16; foreach (var jarItem in jarItems) { output.Append(Html.CheckBox(ini.GetBoolSetting(jarItem, "Checked", false), isCheckBoxDisabled, indentLevel) + ini.GetSetting(jarItem, "Item", "") + Html.br); } } else { return(Html.IndentWithSpaces(16) + "No jar files added"); //Indent the text 16 spaces } } catch (Exception ex) { Logger.Error(ex.ToString()); return(Html.Error(ex.Message) + Html.br); } return(output.ToString()); }
internal static string GetCitrixRecOptions() { StringBuilder output = new StringBuilder(); try { output.Append(Html.B("Configuration") + Html.br); output.Append(Html.IndentWithSpaces() + "Encryption Level: " + ini.GetSetting("Citrix", "Enctyption") + Html.br); output.Append(Html.IndentWithSpaces() + "Window size: " + ini.GetSetting("Citrix", "Window") + Html.br); output.Append(Html.B("Recorder") + Html.br); output.Append(Html.IndentWithSpaces() + "Window name: " + VugenProtocolsCollectorHelper.Citrix.GetCitrixWindowNameOption("CommonNames", "NAMES") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("BITMAPS", "SaveBitmaps", true)) + "Save snapshots"); output.Append(Html.br + Html.B("Code Generation") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("AGENT", "UseAgent", true)) + "Use Citrix agent input in Code Generation" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("AGENT", "SyncOnText", false)) + "Automatically generate text synchronization calls " + Html.br); } catch (Exception ex) { Logger.Error(ex.ToString()); return(Html.Error(ex.ToString())); } return(output.ToString()); }
public static string GetFlexRoInfo() { try { StringBuilder output = new StringBuilder(); output.Append(Html.B("Flex > RTMP") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("RTMP_RO", "GenerateReceiveStream", true)) + "Generate single step for RTMP/T stream handling" + Html.br); output.Append(Html.B("Flex > Configuration") + Html.br); bool useExternalVm = ini.GetBoolSetting("FLEX_RO", "UseExternalVm", false); output.Append(Html.CheckBox(useExternalVm) + "Use external JVM" + Html.br); int indentLevel = 8; if (useExternalVm) { output.Append(Html.IndentWithSpaces(indentLevel) + "External JVM path: " + ini.GetSetting("FLEX_RO", "ExternalVmPath", "") + Html.br); } output.Append(Html.CheckBox(ini.GetBoolSetting("FLEX_RO", "ExternalDsParser", false)) + "Use GraniteDS configuration" + Html.br); output.Append(Html.IndentWithSpaces(indentLevel) + "Maximum formatted Request/Response size to print (in characters): " + ini.GetSetting("FLEX_RO", "MaxReqResSizeToWriteForLog") + Html.br); output.Append(Html.B("Flex > Externalizable objects") + Html.br); bool EncodeExternalizableObject = ini.GetBoolSetting("FLEX_RO", "EncodeExternalizableObject", false); output.Append(Html.CheckBox(!EncodeExternalizableObject) + "Do not serialize externalizable objects" + Html.br); if (EncodeExternalizableObject == true) { output.Append(Html.CheckBox(true) + "Serialize objects using:" + Html.br); bool UseServerParserToParseAmf3 = ini.GetBoolSetting("FLEX_RO", "UseServerParserToParseAmf3", false); bool isCheckBoxDisabled = false; output.Append(Html.CheckBox(!UseServerParserToParseAmf3, isCheckBoxDisabled, indentLevel) + "LoadRunner AMF serializer" + Html.br); isCheckBoxDisabled = UseServerParserToParseAmf3 ? false : true; output.Append(Html.CheckBox(UseServerParserToParseAmf3, isCheckBoxDisabled, indentLevel) + "Custom Java classes" + Html.br); indentLevel = 12; output.Append(Html.CheckBox(ini.GetBoolSetting("FLEX_RO", "UseFlexGlobalJars", false), isCheckBoxDisabled, indentLevel) + "Use Flex LCDS/BlazeDS jars" + Html.br); bool UseAdditionalJars = ini.GetBoolSetting("FLEX_RO", "UseAdditionalJars", false); string additionalJarsList = ""; if (UseAdditionalJars) { additionalJarsList = Html.AddLinkToHiddenContent(GetFlexAdditionalJarFilesInfo(isCheckBoxDisabled)); } output.Append(Html.CheckBox(UseAdditionalJars, isCheckBoxDisabled, indentLevel) + "Use additional jars " + additionalJarsList + Html.br); } output.Append(Html.br + ini.GetSetting("FLEX_RO", "FlexJvmParams") + Html.br); return(output.ToString()); } catch (Exception ex) { Logger.Error(ex.ToString()); return(Html.Error(ex.Message) + Html.br); } }
public static string GetDotNetRecOptions() { StringBuilder output = new StringBuilder(); try { output.Append(Html.B("Microsoft .NET > Recording") + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Application launch") + Html.br); string iniSection = "General"; output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "InvasiveAnyCpuRecording", false), false, 6) + "Modify .NET 'Any CPU' type executable files before recording." + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Support for previous .NET versions") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "EnableV2Emulation", false), false, 6) + "Emulate previous .NET version in transport level" + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Logging") + Html.br); output.Append(Html.IndentWithSpaces(6) + "Log severity: " + ini.GetSetting(iniSection, "LogSeverity") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "InstrumentationLog", false), false, 6) + "Instrumentation log" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "RecordLog", false), false, 6) + "Recording log" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "CodeGenLog", false), false, 6) + "Code generation log" + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Serialization") + Html.br); output.Append(Html.IndentWithSpaces(6) + "Serialization format: " + ini.GetSetting(iniSection, "SerializationFormat", "Binary") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "SerializeLongArray", false), false, 6) + "Serialize long arrays" + Html.br); output.Append(Html.IndentWithSpaces(8) + "Treshold value for long array size: " + ini.GetSetting(iniSection, "MaxArrayLength", "32") + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Remote Objects") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("Remoting", "RecordInprocProxy", false), false, 6) + "Record in-process objects" + Html.br); output.Append(Html.IndentWithSpaces(6) + Html.B("Asynchronous calls") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "RecordOriginalCallbackByDefault", false), false, 6) + "Call original callstack by default" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateAsyncCallback", true), false, 6) + "Generate asynchronous callbacks" + Html.br); output.Append(Html.IndentWithSpaces(6) + Html.B("WCF duplex binding") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateDummyDuplexCallback", true), false, 6) + "Generate dummy callback handler" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateUniqueClientBaseAddress", true), false, 6) + "Generate unique client based address" + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Debug Options") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("Debug", "StackTrace", true), false, 6) + "StackTrace" + Html.br); output.Append(Html.IndentWithSpaces(6) + "Stack trace limit: " + ini.GetSetting("Debug", "StackTraceLimit", "20") + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Filters") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "IgnoreAllAssemblies", false), false, 6) + "Ignore all assemblies by default" + Html.br); output.Append(Html.IndentWithSpaces() + Html.B("Code generation") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "ShowWarnings", true), false, 6) + "Show warnings" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "ShowStackTrace", false), false, 6) + "Show stack trace" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateNewSubscribers", false), false, 6) + "Show all events subscriptions" + Html.br); } catch (Exception ex) { Logger.Error(ex.ToString()); return(ex.ToString()); } return(output.ToString()); }
public static string GetROCodeGen() { StringBuilder output = new StringBuilder(); output.Append(Html.br + Html.B("General > Code Generation") + Html.br); output.Append(Html.IndentWithSpaces() + "Code generation process includes:" + Html.br); string textValue = CorrelationConfigurationHelper.Settings["ScanAfterCodeGeneration"].ToString(); output.Append(Html.CheckBox(textValue == "True", true, 8) + "Correlations scan"); return(output.ToString()); }
/// <summary> /// Creates a html checkbox /// </summary> /// <param name="text">Text that will appear next to the checkbox</param> /// <param name="keyPath">Registry path to value for the checkbox</param> /// <param name="keyName">Name of the registry key that holds the value</param> /// <returns></returns> private static string CreateCheckBoxFromValue(string text, string keyPath, string keyName, string defaultValue = "") { try { var key = Registry.CurrentUser.OpenSubKey(keyPath).GetValue(keyName); string value = key == null ? defaultValue : key.ToString(); bool ticked = false; if (value == "true" || value == "True" || value == "1") { ticked = true; } return(Html.CheckBox(ticked) + text); } catch (Exception ex) { Logger.Error(ex.ToString()); return(Html.CheckBox(defaultValue == "True") + text); } }
public static string GetROScriptLevel() { StringBuilder output = new StringBuilder(); string keyPath = @"Software\Mercury Interactive\Networking\Multi Settings\QTWeb\Recording"; output.Append(Html.br + Html.B("General > Recording") + Html.br); output.Append(Html.IndentWithSpaces() + "HTTP/HTML Level" + Html.br); try { String AnalogMode = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "Analog Mode", "0"); String RecordDILFlag = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "RecordDILFlag", "0"); String RecordOutOfContext = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "Record OutOfContext", "2"); String ConcurrentGroupFlag = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "ConcurrentGroupFlag", "1"); //check if we use HTML mode output.Append(Html.IndentWithSpaces() + Html.Radio((AnalogMode == "0"), 0) + "HTML-based script" + Html.br); if (AnalogMode == "0") { output.Append(Html.IndentWithSpaces() + "Script type: " + Html.br); output.Append(Html.Radio(RecordDILFlag == "0", 8) + "A script describing user actions (e.g. web_link, web_submit_form)" + Html.br); output.Append(Html.Radio(RecordDILFlag == "1", 8) + "A script containing explicit URLs only (e.g. web_url, web_submit_data)" + Html.br); output.Append(Html.IndentWithSpaces() + "Non HTML-generated elements (e.g. JavaScript, VBScript, ActiveX, Applets)" + Html.br); output.Append(Html.Radio(RecordOutOfContext == "2", 8) + "Record within the current script step" + Html.br); output.Append(Html.Radio(RecordOutOfContext == "1", 8) + "Do not record" + Html.br); output.Append(Html.Radio(RecordOutOfContext == "0", 8) + "Record within the current script step" + Html.br); } output.Append(Html.Radio(Convert.ToInt16(AnalogMode) > 0) + "URL-based script" + Html.br); if (Convert.ToInt16(AnalogMode) > 0) { output.Append(Html.CheckBox(ConcurrentGroupFlag == "1") + "Record within the current script step" + Html.br); //If AnalogMode is 3 then the option is checked, if it is 2 it is unchecked output.Append(Html.CheckBox(AnalogMode == "3") + "Use web_custom_request only" + Html.br); } } catch (Exception ex) { Logger.Error(ex.ToString()); } return(output.ToString()); }
internal static string GetRdpRecOptions() { StringBuilder output = new StringBuilder(); try { output.Append(Html.B("Client Startup") + Html.br); output.Append(Html.IndentWithSpaces() + "Run RDP client application: " + VugenProtocolsCollectorHelper.Rdp.GetRdpStartup() + Html.br); output.Append(Html.B("Code Generation - Basic") + Html.br); output.Append(Html.IndentWithSpaces() + "Script generation level: " + ini.GetSetting("CodeGeneration", "RDPScriptLevel") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "MouseMovement", false)) + "Generate mouse movement calls" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "RawMouse", false)) + "Generate raw mouse calls" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "RawKeyboard", false)) + "Generate raw keyboard calls" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "GenerateConnection", false)) + "Always generate connection name" + Html.br); output.Append(Html.IndentWithSpaces() + "Automatic generation of synchronization points: " + GetGenerateAutoSyncPointsInfo() + Html.br); output.Append(Html.IndentWithSpaces(8) + "Sync radius(pixels): " + ini.GetSetting("CodeGeneration", "AutoSyncDelta", "20") + Html.br); //output.Append(Html.CheckBox(ini.GetBoolOption("SaveBitmaps", "BITMAPS", true)) + "Save snapshots"); output.Append(Html.br + Html.B("Code Generation - Adv") + Html.br); output.Append(Html.IndentWithSpaces() + "Double-click timeout (msec): " + ini.GetSetting("CodeGeneration", "DblClickThreshold", "500") + Html.br); output.Append(Html.IndentWithSpaces() + "Prefix for snapthos names: " + ini.GetSetting("CodeGeneration", "SnapshotsPrefix", "snapshot_") + Html.br); output.Append(Html.IndentWithSpaces() + "Prefix for clipboard parameters: " + ini.GetSetting("CodeGeneration", "ClipboardParamsPrefix", "ClipboardDataParam_") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "ClipboardParamsCorrelation", true)) + "Correlate clipboard parameters" + Html.br); output.Append(Html.br + Html.B("Code Generation - Agent") + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "UseRdpAgent", false)) + "Use RDP agent" + Html.br); output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "EnableRdpAgentLog", false)) + "Enable RDP agent log" + Html.br); output.Append(Html.IndentWithSpaces(5) + "RDP agent log detail level: " + ini.GetSetting("CodeGeneration", "RdpAgentLogSeverityLevel", "Standard") + Html.br); output.Append(Html.IndentWithSpaces(5) + "RDP agent log destination: " + ini.GetSetting("CodeGeneration", "RdpAgentLogDestination", "File") + Html.br); output.Append(Html.IndentWithSpaces(5) + "RDP agent log folder: " + ini.GetSetting("CodeGeneration", "RdpAgentLogFileFolder", "") + Html.br); } catch (Exception ex) { Logger.Error(ex.ToString()); return(ex.ToString()); } return(output.ToString()); }
public override string ToString() { return(Html.CheckBox(enabled) + name + " " + Html.AddLinkToHiddenContent(RulesToHtml()) + Html.br); }
/// <summary> /// Must be executed only on vugen > 11.5 /// </summary> /// <returns></returns> public static string GetROCorrelationConfig() { StringBuilder output = new StringBuilder(); output.Append(Html.br + Html.B("Correlations > Configuration") + Html.br); output.Append((Html.IndentWithSpaces() + "Scan for correlations applying: ") + Html.br); try { XmlDocument doc = new XmlDocument(); string filePath = Path.Combine(ProductDetection.Vugen.ConfigFolder, "CorrelationConfiguration.xml"); if (File.Exists(filePath)) { doc.Load(filePath); } //string textValue = GetNodeText(doc, "/CorrelationOptions/Correlation.RuleScanEnabled", "True"); string textValue = CorrelationConfigurationHelper.Settings["RuleScanEnabled"].ToString(); output.Append(Html.CheckBox(textValue == "True", false) + "Rules scan" + Html.br); textValue = CorrelationConfigurationHelper.Settings["AutomaticApplyRules"].ToString(); output.Append(Html.CheckBox(textValue == "True", false, 8) + "Automatically correlate values found" + Html.br); textValue = CorrelationConfigurationHelper.Settings["RecordScanEnabled"].ToString(); output.Append(Html.CheckBox(textValue == "True", false) + "Record scan" + Html.br); textValue = CorrelationConfigurationHelper.Settings["ReplayScanEnabled"].ToString(); output.Append(Html.CheckBox(textValue == "True", false) + "Replay scan" + Html.br); output.Append((Html.IndentWithSpaces(8) + "Record and Replay scan configuration") + Html.br); var UseRegExpCorrelationText = new Hashtable() { { "True", "web_reg_save_param_regexp" }, { "False", "web_reg_save_param_ex" } }; textValue = CorrelationConfigurationHelper.Settings["UseRegExpCorrelation"].ToString(); output.Append(Html.IndentWithSpaces(12) + "API used for correlations: " + UseRegExpCorrelationText[textValue] + Html.br); textValue = CorrelationConfigurationHelper.Settings["MinCorrelationLength"].ToString(); output.Append(Html.IndentWithSpaces(12) + "Ignore values shorter than: " + textValue + Html.br); textValue = CorrelationConfigurationHelper.Settings["MaxCorrelationLength"].ToString(); output.Append(Html.IndentWithSpaces(12) + "Ignore values longer than: " + textValue + Html.br); textValue = CorrelationConfigurationHelper.Settings["WarnOnLargeDifferences"].ToString(); output.Append(Html.CheckBox(textValue == "True", false, 12) + "Warn me if the dynamic string size is greater than 10 KB" + Html.br); textValue = CorrelationConfigurationHelper.Settings["IsIgnoreCases"].ToString(); output.Append(Html.CheckBox(textValue == "True", false, 12) + "Ignore case when searching for correlatable values" + Html.br); output.Append((Html.IndentWithSpaces(8) + "Record scan configuration:") + Html.br); textValue = CorrelationConfigurationHelper.Settings["RuleHeuristicLevel"].ToString(); var RuleHeuristicLevelText = new Hashtable() { { "Medium", "Medium" }, { "Strict", "High" }, { "Loose", "Low" } }; output.Append((Html.IndentWithSpaces(12) + "Scan for differences between snapshots using: ") + RuleHeuristicLevelText[textValue] + Html.br); output.Append((Html.IndentWithSpaces(8) + "Replay scan configuration:") + Html.br); output.Append((Html.IndentWithSpaces(12) + "Scan for differences between snapshots using:") + Html.br); textValue = CorrelationConfigurationHelper.Settings["TypeOfScanDiff"].ToString(); output.Append((Html.CheckBox(textValue == "1", false, 14) + "HTML comparison") + Html.br); output.Append((Html.CheckBox(textValue == "0", false, 14) + "Text comparison") + Html.br); } catch (Exception ex) { Logger.Error(ex.ToString()); return(output.ToString() + Html.br + ex.Message); } return(output.ToString()); }
public static string GetROHttpProperties() { StringBuilder output = new StringBuilder(); output.Append(Html.br + Html.B("HTTP Properties > Advanced") + Html.br); try { string keyPath = @"Software\Mercury Interactive\Networking\Multi Settings\QTWeb\Recording"; output.Append(CreateCheckBoxFromValue("Reset context for each action", keyPath, "ResetContextBetweenActions") + Html.br); output.Append(CreateCheckBoxFromValue("Save snapshots locally", keyPath, "SaveSnapshotResources") + Html.br); output.Append(CreateCheckBoxFromValue("Generate web_reg_find functions for page titles", keyPath, "RecordWebRegFind") + Html.br); output.Append(Html.IndentWithSpaces() + CreateCheckBoxFromValue("Generate web_reg_find functions for sub-frames", keyPath, "RecordWebRegFindNonPrimary") + Html.br); output.Append(CreateCheckBoxFromValue("Add comment to script for HTTP errors while recording", keyPath, "AddCommentsIfResponceBiggerThen400") + Html.br); output.Append((Html.IndentWithSpaces() + "Support charset") + Html.br); output.Append(Html.IndentWithSpaces() + CreateCheckBoxFromValue("Support charset UTF-8", keyPath, "Utf8Support") + Html.br); output.Append(Html.IndentWithSpaces() + CreateCheckBoxFromValue("Support charset EUC-JP", keyPath, "EUC Encode") + Html.br); //on LR < 11.5 this doesn't exist string ParameterizeServerNames = RegistryWrapper.GetRegKey32(RegHive.CurrentUser, @"Software\Mercury Interactive\Networking\Multi Settings\GlobalParameterizeServer\Recording", "ParameterizeServerNames"); if (ParameterizeServerNames != null) { output.Append(CreateCheckBoxFromValue("Parameterize server names", @"Software\Mercury Interactive\Networking\Multi Settings\GlobalParameterizeServer\Recording", "ParameterizeServerNames") + Html.br); } String file = Path.Combine(ProductDetection.Vugen.ConfigFolder, "vugen.ini"); String settingEngine = Html.ErrorMsg(); if (File.Exists(file)) { IniParser vugenIni = new IniParser(file); //Pre 12 versions: if (ProductDetection.Vugen.version < new Version(12, 00)) { string oldRecEngine = vugenIni.GetSetting("WebRecorder", "EnableOldSingleRecorded"); settingEngine = Html.CheckBox(oldRecEngine == "1") + "Record using earlier recording engine"; output.Append(Html.br + (Html.IndentWithSpaces() + "Recording engine: " + Html.br + Html.IndentWithSpaces() + settingEngine + Html.br)); } else { string UseProxyRecorder = vugenIni.GetSetting("WebRecorder", "UseProxyRecorder"); string ProxyInStreamMode = vugenIni.GetSetting("WebRecorder", "ProxyInStreamMode"); output.Append(Html.br + Html.IndentWithSpaces(4) + "Proxy Recording settings:" + Html.br); output.Append(Html.CheckBox(UseProxyRecorder == "1", false, 8) + "Use the LoadRunner Proxy to record a local application" + Html.br); output.Append(Html.CheckBox(ProxyInStreamMode == "1", false, 8) + "Use streaming mode when recording with the LoadRunner Proxy" + Html.br); } } output.Append(Html.br + Html.IndentWithSpaces(4) + "Recording schemes: " + Html.br); string CustomHeadersKey = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "CustomHeaderFlag", "2"); string headersMessage = "Record headers <b>not</b> in the list"; if (CustomHeadersKey == "1") { headersMessage = "Record headers in the list"; } else if (CustomHeadersKey == "0") { headersMessage = "Do not record headers"; } output.Append(Html.IndentWithSpaces(8) + "Headers: " + headersMessage + Html.br); if (CustomHeadersKey != "0") { string headersKey = CustomHeadersKey == "2" ? "CustomHeadersExclude" : "CustomHeaders"; string headers = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, headersKey, ""); var parts = Regex.Split(headers, @"(?<=[01])").ToList(); parts.RemoveAll(item => item.EndsWith("0") || item.Equals("")); output.Append(Html.IndentWithSpaces(12) + String.Join(Html.IndentWithSpaces(8), parts.ToArray()).Replace("\n1", Html.br).Replace("\n", Html.IndentWithSpaces(2))); } string ContentTypeFilterKey = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "ContentTypeFilterFlag", "0"); var contentMessage = new Hashtable() { { "0", "Do not filter content types" }, { "1", "Exclude content types in list:" }, { "2", "Exclude content types <b>not</b> in list:" } }; output.Append(Html.br + Html.IndentWithSpaces(8) + "Content types: " + contentMessage[ContentTypeFilterKey] + Html.br); if (ContentTypeFilterKey != "0") { string filtersKey = ContentTypeFilterKey == "2" ? "ContentTypeFilterExclude" : "ContentTypeFilter"; string content = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, filtersKey, ""); var parts = Regex.Split(content, @"(?<=[01])").ToList(); parts.RemoveAll(item => item.EndsWith("0") || item.Equals("")); output.Append(Html.IndentWithSpaces(12) + String.Join(Html.IndentWithSpaces(8), parts.ToArray()).Replace("\n1", Html.br).Replace("\n", Html.IndentWithSpaces(2))); } } catch (Exception ex) { Logger.Error(ex.ToString()); return(output + ex.Message); } return(output.ToString()); }
public static string GetROPortMappingServers() { StringBuilder output = new StringBuilder(); output.Append((Html.IndentWithSpaces() + "Server entries: ")); string keyPath = @"Software\Mercury Interactive\LoadRunner\Protocols\WPlus\Servers"; try { string[] serverEntries = Registry.CurrentUser.OpenSubKey(keyPath).GetSubKeyNames(); foreach (string entry in serverEntries) { RegistryKey rk = Registry.CurrentUser.OpenSubKey(keyPath + "\\" + entry); string Acvite = rk.GetValue("Active").ToString(); string UseProxy = rk.GetValue("UseProxy").ToString(); string SSL_Active = rk.GetValue("SSL_Active").ToString(); string SSL_AutoSslDetect = rk.GetValue("SSL_AutoSslDetect").ToString(); bool selected = Acvite == "true"; string recordType = UseProxy == "true" ? "Proxy" : "Direct"; string connectionType = ""; string Clnt_SSL_Version = ""; string Clnt_SSL_Ciphers = ""; string Svr_SSL_Certificate = ""; string Clnt_SSL_Certificate = ""; if (recordType == "Proxy") { connectionType = ", Connection type: Plain"; if (SSL_AutoSslDetect == "true") { connectionType = ", Connection type: Auto"; } if (SSL_Active == "true") { connectionType = ", Connection type: SSL"; } Clnt_SSL_Version = rk.GetValue("Clnt_SSL_Version").ToString(); Clnt_SSL_Version = ", SSL version " + sslVersions[Clnt_SSL_Version].ToString(); Clnt_SSL_Ciphers = rk.GetValue("Clnt_SSL_Ciphers").ToString(); Clnt_SSL_Ciphers = ", SSL cipher " + Clnt_SSL_Ciphers; Svr_SSL_Certificate = rk.GetValue("Svr_SSL_Certificate").ToString(); if (Svr_SSL_Certificate != "") { Svr_SSL_Certificate = ", client certificate: " + Svr_SSL_Certificate; } Clnt_SSL_Certificate = rk.GetValue("Clnt_SSL_Certificate").ToString(); if (Clnt_SSL_Certificate != "") { Clnt_SSL_Certificate = ", proxy-server certificate: " + Clnt_SSL_Certificate; } } output.Append(Html.br + Html.CheckBox(selected, true, 8) + entry + ", Record type: " + recordType + connectionType + Clnt_SSL_Version + Svr_SSL_Certificate + Clnt_SSL_Certificate + Html.br); } } catch (NullReferenceException ex) { Logger.Error(ex.ToString()); output.Append("None" + Html.br); } catch (Exception ex) { Logger.Error(ex.ToString()); return(ex.Message); } return(output.ToString()); }