Пример #1
0
 public HttpRedirect(RedirectSettings settings)
 {
     _queryRules = settings.QueryRules ?? new Dictionary<Regex, string>();
     _contentRules = settings.ContentRules ?? new Dictionary<string, Dictionary<Regex, string>>();
     _listener = new HttpListener();
     foreach (var url in settings.Froms)
     {
         _listener.Prefixes.Add(url);
     }
     _toUrl = new Uri(settings.To);
 }
Пример #2
0
 public HttpRedirect(RedirectSettings settings)
 {
     _queryRules   = settings.QueryRules ?? new Dictionary <Regex, string>();
     _contentRules = settings.ContentRules ?? new Dictionary <string, Dictionary <Regex, string> >();
     _listener     = new HttpListener();
     foreach (var url in settings.Froms)
     {
         _listener.Prefixes.Add(url);
     }
     _toUrl = new Uri(settings.To);
 }