Developer

C# Coding Samples

Activation

// https://restsharp.dev/
using System;
using RestSharp;
var client = new RestClient("https://api.keyzy.io/v2/licenses/valid");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n\t\"app_id\": \"your-app-id\",\n \"api_key\": \"your-api-key\",\n \"host_id\": \"host-id\",\n \"serial\": \"the-serial-number\", \n \"code\": \"product-code\",\n \"version\": \"2.0\",\n \"device_tag\": \"device-tag\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

How To Obtain Host ID in Windows Systems

using System;
using Microsoft.Win32;
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Cryptography");
//if it does exist, retrieve the stored values  
if (key != null)
{
    Console.WriteLine("Device ID: " + key.GetValue("MachineGuid"));
    key.Close();
}