Why does this code keep on failing? It works for a bit then they all crash.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GroupFinderPart1
{
public class Program
{
static void Main()
{
new Program().Check();
}
private void Check()
{
// This is getting your settings file to check if it has on or off in it....
try
{
string text = File.ReadAllText(Application.StartupPath + "\\settings.txt");
string lower = text.ToLower();
if (lower == "disabled")
{
Application.Exit();
}
else
{
if (lower == "enabled")
{
Task w = Task.Delay(600);
w.Wait();
new Program().Start();
}
else
{
MessageBox.Show("That is not enabled or disabled!");
}
}
}
catch
{
}
}
private void Start()
{
try
{
//The group finder....
Random random = new Random();
int i = random.Next(0, 1000000);
string test = new System.Net.WebClient().DownloadString("http://www.roblox.com/groups/group.aspx?gid=" + i);
if (test.Contains(">No One!</a>"))
{
Console.WriteLine("A group with no owner has been found!");
if (test.Contains("<b>Funds:</b>"))
{
Console.WriteLine("A group with funds has been found!");
if (test.Contains(">0</span>"))
{
Console.WriteLine("No funds found in a group with no owner!");
Check();
}
else
{
File.WriteAllText(Application.StartupPath + "\\group.txt", "**Group found:** http://www.roblox.com/groups/group.aspx?gid=" + i);
Console.WriteLine("Group with funds outputted!");
Check();
}
}
else
{
Check();
}
}
else
{
Check();
}
}
catch
{
Check();
}
Check();
}
}
}