BoxedIce.ServerDensity.Agent.PayloadPoster.PayloadPoster C# (CSharp) Метод

PayloadPoster() публичный Метод

Initialises a new instance of the PayloadPoster class with the provided values.
public PayloadPoster ( AgentConfigurationSection config, object>.IDictionary results ) : System
config AgentConfigurationSection
results object>.IDictionary The payload dictionary.
Результат System
        public PayloadPoster(AgentConfigurationSection config, IDictionary<string, object> results)
        {
            _config = config;
            _results = results;
            _results.Add("os", "windows");
            _results.Add("agentKey", _config.AgentKey);

            try
            {
                _results.Add("internalHostname", Environment.MachineName);
            }
            catch (InvalidOperationException)
            {
            }

            if (_version == null)
            {
                Assembly asm = Assembly.Load(File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BoxedIce.ServerDensity.Agent.exe")));
                Version installedVersion = asm.GetName().Version;
                _version = installedVersion.ToString();
            }

            _results.Add("agentVersion", _version);
        }