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);
}