0

Do you have any idea to change the code and avoid to use MapToIPv4 because my computer is Visual studio 2010?

    hostIP = ipHostInfo.AddressList(CType(logNconfig.Addresslist.ToString(), Integer))
    TxtIP.Text = hostIP.MapToIPv4.ToString()

    hostIP = System.Net.IPAddress.Parse(TxtIP.Text)

    server = Nothing
    server = New TcpListener(hostIP, TxtPort.Text)

    server.Start()

Do you have any idea to solve this? :( i want run it as visual studio 2010..

Alex Keoh
  • 3
  • 4
  • You *could* go and look at the [Reference Source](http://referencesource.microsoft.com/#System/net/System/Net/IPAddress.cs,cae19ee54c742f78). However, there's a problem - the code is actually buggy. So you would actually also want to examine [this question/answer](http://stackoverflow.com/questions/23608829/why-does-ipaddress-maptoipv4-throw-argumentoutofrangeexception) – Damien_The_Unbeliever Jan 06 '15 at 07:35

1 Answers1

0

You can retrieve the IPaddress by using Dim hostname As String = Dns.GetHostName() Dim ipaddress As String = CType(Dns.GetHostEntry(hostname).AddressList.GetValue(0), IPAddress).ToString View Sample

Community
  • 1
  • 1