Hi,
My apologies to post it here, as the question isn't very much specific to Fiddler, rather for the programming languages in use for Fiddler, like JScript.NET and C# in general.
I've below snippet written in the FiddlerScript (using JScript.NET) to match the hostname against a set of RegEx patterns, and I'm trying to port into C#, but it doesn't seem to work. Any help is appreciated.
var
sHostname = oSession.hostname;
switch
(sHostname) {
case
/example1.com/i.test(sHostname) && sHostname:
case
/example2.com/i.test(sHostname) && sHostname:
case
/example3.com/i.test(sHostname) && sHostname:
MessageBox.Show(
"Matched: "
+ sHostname);
default
:
FiddlerApplication.Log.LogString(
"No match for hostname."
);
}
Cheers,