I have several VB program written in Visual Studio 2017 When my program loads it checks the host name and IP address of the computer for security logging. This worked fine up until the last week when the programs will no longer run on Windows 10 Systems. They still work on Windows 7.
Here is the code that gets the info:
Dim strHostName As String = System.Net.Dns.GetHostName() Dim iphe As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(strHostName) Dim strIPAddress As String . . . For Each ipheal As System.Net.IPAddress In iphe.AddressList If ipheal.AddressFamily = System.Net.Sockets.AddressFamily.InterNetwork Then strIPAddress = ipheal.ToString() Next
This is the error from windows event viewer:
Description: The process was terminated due to an unhandled exception. Exception Info: System.Net.Sockets.SocketException at System.Net.Dns.GetAddrInfo(System.String) at System.Net.Dns.InternalGetHostByName(System.String, Boolean) at System.Net.Dns.GetHostEntry(System.String) at Program.Form1..ctor()
. . . Faulting module name: KERNELBASE.dll, version: 10.0.17134.1, time stamp: 0x701ca188 Exception code: 0xe0434352
Any ideas what could be causing this and how to implement a workaround?
Thanks in advance.
User contributions licensed under CC BY-SA 3.0