summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Helpers/ApplicationHelper.cs
blob: 97acd7d1134f9118956a79f522a96f0486bd3567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using Agger.Registro;
using Gestor.Common.Helpers;

namespace Gestor.Application.Helpers;

public class ApplicationHelper
{
	private static string _numeroSerial;

	private const string ChaveSerial = "NS";

	public static string NumeroSerial
	{
		get
		{
			return _numeroSerial ?? GetSerialNumber();
		}
		set
		{
			_numeroSerial = value;
		}
	}

	public static bool Conectado { get; set; } = true;


	public static bool Beta { get; set; } = false;


	public static long IdFornecedor { get; set; }

	public static string Subkey { get; set; }

	public static DateTime ChecagemVersao { get; set; } = Funcoes.GetNetworkTime();


	public static Version Versao { get; set; }

	internal static string GetSerialNumber()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			string text = new RegistryHelper(Subkey).Read("NS", true);
			NumeroSerial = (string.IsNullOrEmpty(text) ? null : EncryptionHelper.Decrypt(text));
			return NumeroSerial;
		}
		catch (Exception)
		{
			return null;
		}
	}
}