Hello,
how to check if a hit as variable already exist in my file or not! if anyone can give me the piece of code
Hello,
how to check if a hit as variable already exist in my file or not! if anyone can give me the piece of code
Can you please provide an example?
i’m making config to scrape proxy so if bot get hit the bot will open file at …/hits/success.txt and check if line exist bot will end with Fail
You need some C# for this.
Bad but easy solution:
First of all use the File Read Lines block to read all the lines from the proxy file (e.g. call the output variable lines
), then do something like
if (lines.Any(line => line == myProxy))
{
data.STATUS = "FAIL";
return;
}
Better solution:
Reading the file all the time is bad, you should keep a global concurrent dictionary of the proxies you found and you can query it in O(1) time so it’s really fast and will not have a problem with concurrency.