Changeset 8134
- Timestamp:
- 06/27/12 16:53:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Access/3.3/ClientInformationUtils.cs
r8042 r8134 22 22 using System; 23 23 using System.Diagnostics; 24 using System.IO; 24 25 using System.Management; 25 26 using System.Reflection; 27 using System.Security.Cryptography; 28 using System.Text; 26 29 using HeuristicLab.Algorithms.Benchmarks; 27 30 using HeuristicLab.Data; … … 46 49 client.ProcessorType = GetCpuInfo(); 47 50 client.ClientType = cType; 48 //client.ClientConfiguration = GetClientConfiguration();51 client.ClientConfiguration = GetClientConfiguration(); 49 52 client.Timestamp = DateTime.Now; 50 53 client.PerformanceValue = RunBenchmark(); … … 53 56 } 54 57 55 public static string GetClientConfiguration() { 56 //TODO: does it make sense to send the client configuration to the server? for what do we need this? 57 return string.Empty; 58 public static ClientConfiguration GetClientConfiguration() { 59 try { 60 string filePath = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; 61 byte[] fileContent = File.ReadAllBytes(filePath); 62 byte[] hashBytes; 63 using (SHA1 sha1 = SHA1.Create()) hashBytes = sha1.ComputeHash(fileContent); 64 StringBuilder sb = new StringBuilder(); 65 foreach (byte b in hashBytes) sb.Append(b.ToString("x2")); 66 return new ClientConfiguration { Hash = sb.ToString() }; 67 } 68 catch { 69 return null; 70 } 58 71 } 59 72
Note: See TracChangeset
for help on using the changeset viewer.