示例#1
0
 public DnsAgent(Options options, Rules rules, string listenOn, DnsMessageCache cache)
 {
     Options = options ?? new Options();
     Rules = rules ?? new Rules();
     _listenOn = listenOn;
     Cache = cache ?? new DnsMessageCache();
 }
示例#2
0
 private static Options ReadOptions()
 {
     Options options;
     if (File.Exists(Path.Combine(Environment.CurrentDirectory, OptionsFileName)))
     {
         options = JsonConvert.DeserializeObject<Options>(
             File.ReadAllText(Path.Combine(Environment.CurrentDirectory, OptionsFileName)));
     }
     else
     {
         options = new Options();
         File.WriteAllText(Path.Combine(Environment.CurrentDirectory, OptionsFileName),
             JsonConvert.SerializeObject(options, Formatting.Indented));
     }
     return options;
 }
示例#3
0
 public DnsAgent(Options options, Rules rules)
 {
     Options = options ?? new Options();
     Rules = rules ?? new Rules();
     Cache = new DnsMessageCache();
 }