Skip to content

Commit

Permalink
Regions
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiodeveloper committed Jun 20, 2016
1 parent 3fb0e69 commit 96bb6fa
Show file tree
Hide file tree
Showing 42 changed files with 42 additions and 30 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/bin/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/bin/NoTest/RobotsExplorer.Util.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.HttpManager.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.HttpManager.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Test.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Test.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.Test/obj/Debug/RobotsExplorer.Test.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/obj/Debug/RobotsExplorer.Test.pdb
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.Util/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.Util/bin/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Util/bin/NoTest/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.Util/obj/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.Util/obj/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Util/obj/NoTest/RobotsExplorer.Util.dll
Binary file not shown.
72 changes: 42 additions & 30 deletions RobotsExplorer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public static void Main(string[] args)

#region Private Methods

#region Flow

private static void PreExecution(string domain)
{
if (!string.IsNullOrEmpty(domain))
Expand All @@ -70,6 +72,40 @@ private static void PreExecution(string domain)
Execute();
}

private static void Execute()
{
Util.Util.ChangeConsoleColorToDefault();

WriteMessageAndSkipLine("-------------------------------------------", 0);
WriteMessageAndSkipLine("<<< PROCESSING >>> " + _urlTarget, 0);
WriteMessageAndSkipLine("-------------------------------------------", 1);
WriteMessageAndSkipLine("Localizing target host...", 1);

httpManager = new HttpManager.HttpManager();

if (CanMakeMoreRequest())
{
WebRequest request = httpManager.WebRequestFactory(_urlTarget, _proxy, _userAgent, _requestTimeout);
WebResponse response = request.GetResponse();

controlRequestQuantity++;

if (((HttpWebResponse)response).StatusCode == HttpStatusCode.OK)
ProcessResponse((HttpWebResponse)response);
else
{
Util.Util.ChangeConsoleColorToRed();
WriteMessageAndSkipLine("Sorry, I failed when I try to access the target :(", 0);
}
}
else
WriteMessageAndSkipLine("Sorry, you have reached the maximum number of requests that you informed as a parameter {r=" + _requestQuantity + "}.", 0);
}

#endregion

#region Auxiliary

private static void FormatDomainInput()
{
if (_urlTarget.ToLower().EndsWith(".txt") || _urlTarget.ToLower().EndsWith(".txt/"))
Expand Down Expand Up @@ -162,36 +198,6 @@ private static void DisplayVersion()
WriteMessageAndSkipLine(GetRobotsExplorerVersion(), 0);
}

private static void Execute()
{
Util.Util.ChangeConsoleColorToDefault();

WriteMessageAndSkipLine("-------------------------------------------", 0);
WriteMessageAndSkipLine("<<< PROCESSING >>> " + _urlTarget, 0);
WriteMessageAndSkipLine("-------------------------------------------", 1);
WriteMessageAndSkipLine("Localizing target host...", 1);

httpManager = new HttpManager.HttpManager();

if (CanMakeMoreRequest())
{
WebRequest request = httpManager.WebRequestFactory(_urlTarget, _proxy, _userAgent, _requestTimeout);
WebResponse response = request.GetResponse();

controlRequestQuantity++;

if (((HttpWebResponse)response).StatusCode == HttpStatusCode.OK)
ProcessResponse((HttpWebResponse)response);
else
{
Util.Util.ChangeConsoleColorToRed();
WriteMessageAndSkipLine("Sorry, I failed when I try to access the target :(", 0);
}
}
else
WriteMessageAndSkipLine("Sorry, you have reached the maximum number of requests that you informed as a parameter {r=" + _requestQuantity + "}.", 0);
}

private static bool CanMakeMoreRequest()
{
if (controlRequestQuantity <= _requestQuantity)
Expand All @@ -200,6 +206,12 @@ private static bool CanMakeMoreRequest()
return false;
}

#endregion





private static void FinishExecution()
{
Util.Util.ChangeConsoleColorToDefault();
Expand Down
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.HttpManager.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.HttpManager.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.exe
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/NoTest/RobotsExplorer.HttpManager.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/NoTest/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/NoTest/RobotsExplorer.exe
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer/obj/Debug/RobotsExplorer.exe
Binary file not shown.
Binary file modified RobotsExplorer/obj/Debug/RobotsExplorer.pdb
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer/obj/NoTest/RobotsExplorer.exe
Binary file not shown.

0 comments on commit 96bb6fa

Please sign in to comment.