Changeset 8331 for branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Access/3.3/ClientInformationUtils.cs
- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Access/3.3/ClientInformationUtils.cs
r8086 r8331 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.