Esempio n. 1
0
 /// <summary>
 /// Creates an instance of a Wordlist.
 /// </summary>
 /// <param name="name">The name of the Wordlist</param>
 /// <param name="path">The path to the file on disk. Use null if the config only resides in memory.</param>
 /// <param name="type">The WordlistType as a string</param>
 /// <param name="purpose">The purpose of the Wordlist</param>
 /// <param name="countLines">Whether to enumerate the total number of data lines in the Wordlist</param>
 public Wordlist(string name, string path, WordlistType type, string purpose, bool countLines = true)
 {
     Name    = name ?? throw new ArgumentNullException(nameof(name));
     Path    = path;
     Type    = type ?? throw new ArgumentNullException(nameof(type));
     Purpose = purpose ?? "";
     Total   = countLines ? Total = File.ReadLines(path).Count() : 0;
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a CData object given some <paramref name="data"/> and the <paramref name="wordlistType"/>.
 /// </summary>
 public DataLine(string data, WordlistType wordlistType)
 {
     Data = data ?? throw new ArgumentNullException(nameof(data));
     Type = wordlistType ?? throw new ArgumentNullException(nameof(wordlistType));
 }