Fixed missing reference

This commit is contained in:
Rick Falkvinge
2015-05-21 15:09:18 +02:00
parent d7300afa71
commit 25ebf7f9c5
2 changed files with 37 additions and 1 deletions
+6 -1
View File
@@ -68,8 +68,12 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\External Dependencies\bin\NBitcoin.dll</HintPath>
</Reference>
<Reference Include="NGeoIP, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NGeoIP.1.0.1\lib\net45\NGeoIP.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RestSharp, Version=104.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.104.2.0\lib\net4\RestSharp.dll</HintPath>
<HintPath>..\packages\NGeoIP.1.0.1\lib\net45\RestSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Starksoft.Cryptography.OpenPGP, Version=1.0.140.0, Culture=neutral, processorArchitecture=MSIL">
@@ -288,6 +292,7 @@
<Compile Include="Security\BCrypt.cs" />
<Compile Include="Security\PgpKey.cs" />
<Compile Include="Special\DummyBitcoin.cs" />
<Compile Include="Special\DummyGeoLookup.cs" />
<Compile Include="Special\Sweden\SupportCase.cs" />
<Compile Include="Special\Sweden\SupportCaseDelta.cs" />
<Compile Include="Special\Sweden\SupportDatabase.cs" />
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using NGeoIP;
using NGeoIP.Client;
namespace Swarmops.Logic.Special
{
/// <summary>
/// The point of this class is to reference NGeoIP, so the DLL gets copied to the output folder for Site to use.
/// Kind of a kludgy hack, but works.
/// </summary>
public class DummyGeoLookup
{
public static string Lookup (string ip)
{
NGeoIP.Request request = new Request()
{
Format = Format.Json,
IP = HttpContext.Current.Request.UserHostAddress
};
NGeoClient client = new NGeoClient(request);
NGeoIP.RawData rawData = client.Execute();
return rawData.CountryCode;
}
}
}