public BrowserProfileService(string chromiumPath, string profilesPath, IFingerprintStore fingerprintStore) { _chromiumPath = chromiumPath; _profilesPath = profilesPath; _fingerprintStore = fingerprintStore; _profilesJsonPath = Path.Combine(_profilesPath, "profiles.json"); try { _browserProfiles = JsonConvert.DeserializeObject <List <BrowserProfile> >(File.ReadAllText(_profilesJsonPath, System.Text.Encoding.UTF8)); } catch (Exception exception) { Log.Error(exception); } if (_browserProfiles == null) { _browserProfiles = new List <BrowserProfile>(); } if (!_browserProfiles.Any()) { _browserProfiles.Add(new BrowserProfile { Name = Path.GetRandomFileName(), Folder = Path.GetRandomFileName(), ProxyRecord = new ProxyRecord() }); } }
public FingerprintToDbApplication(ILogger <FingerprintToDbApplication> logger, IConfiguration configuration, IFingerprintStore fingerprintStore) { _logger = logger; _fingerprintsFolders = configuration.GetSection(_fingerprintsFoldersKey).Get <List <string> >(); _fingerprintStore = fingerprintStore; }