Changeset 4285 for branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/WcfSettings.cs
- Timestamp:
- 08/23/10 13:07:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/WcfSettings.cs
r2607 r4285 73 73 /// </summary> 74 74 /// <returns></returns> 75 public static string GetActiveIP() { 76 return System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections()[0].LocalEndPoint.Address.ToString(); 75 public static IPAddress GetActiveIP() { 76 //return System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections()[0].LocalEndPoint.Address.ToString(); 77 IPAddress[] addresses; 78 addresses = Dns.GetHostAddresses(Dns.GetHostName()); 79 int index = 0; 80 if (System.Environment.OSVersion.Version.Major >= 6) { 81 for (index = addresses.Length - 1; index >= 0; index--) 82 if (addresses[index].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) 83 break; 84 } 85 return addresses[index]; 77 86 } 78 87
Note: See TracChangeset
for help on using the changeset viewer.