Skip to content

Commit

Permalink
fixed .NET v461 compatibility issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown6656 committed Feb 4, 2020
1 parent 82d73e7 commit fb3e3b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions unlocker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public static class Program
"kms8.MSGuides.com",
"kms9.MSGuides.com",
};
public static readonly (string[] parts, string serial) KEY = (new[]
{
public static readonly string KEY_SERIAL = "XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99";
public static readonly string[] KEY_PARTS = {
"WFG99",
"DRTFM",
"BTDRB",
"CPQVG"
}, "XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99");
};

public static void Main()
{
Expand Down Expand Up @@ -87,7 +87,7 @@ _ _ _ __ | | ___ __ _____ ___ __ / /_ / /_| ___| / /_
Console.WriteLine("KMS Script location: " + ospp.FullName);
}

(int exit, string stdout) exec_ospp(string args)
Tuple<int, string> exec_ospp(string args)
{
using (Process proc = new Process
{
Expand Down Expand Up @@ -126,7 +126,7 @@ _ _ _ __ | | ___ __ _____ ___ __ / /_ / /_| ___| / /_
Console.WriteLine(stderr);
}

return (proc.ExitCode, stdout);
return new Tuple<int, string>(proc.ExitCode, stdout);
}
}
DirectoryInfo licencedir = new DirectoryInfo($"{ospp.Directory.FullName}/../root/Licenses16");
Expand All @@ -140,18 +140,18 @@ _ _ _ __ | | ___ __ _____ ___ __ / /_ / /_| ___| / /_
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine("Activating Microsoft Office ...");

foreach (string part in KEY.parts)
foreach (string part in KEY_PARTS)
exec_ospp($"/unpkey:{part}");

exec_ospp($"/inpkey:{KEY.serial}");
exec_ospp($"/inpkey:{KEY_SERIAL}");

foreach (string server in KMS_SERVERS)
{
exec_ospp($"/sethst:{server}");

(_, string result) = exec_ospp("/act");
Tuple<int, string> result = exec_ospp("/act");

if (result.ToLower().Contains("successful"))
if (result.Item2.ToLower().Contains("successful"))
{
activated = true;

Expand Down
4 changes: 2 additions & 2 deletions unlocker/unlocker.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
</Project>

0 comments on commit fb3e3b3

Please sign in to comment.