Jump to content

[VB.NET 2005] String To Long


Recommended Posts

Posted
       Dim str As String
        Dim byip As Long
        Dim ip As IPEndPoint
        str = iplista(0).ToString
        byip = Long.Parse(str)
        ip = New IPEndPoint(byip, 6000)

Faço isto e diz: Input string was not in a correct format.

o iplista é um arraylist q vem de tratrás onde estão os ip's guardados

como é que converto uma string num valor Long, é para aplicar aki:

                                                                                                            tcpcliente.Client.SendTo(sendbytes, 0, sendbytes.Length, SocketFlags.None, ip)

Posted

Tenta isto.

         Dim str As String
        Dim byip As Long
        Dim ip As IPEndPoint
        str = iplista(0).ToString
        byip = Long.Parse(str,Globalization.NumberStyles.Any)
        ip = New IPEndPoint(byip, 6000)

"The Dark Side Clouds Everthing. Impossible To See The Future Is."My rig: Intel Core 2 Quad Q9450 | abit IP35P | 4G Kingston 800 Mhz | XFX GeForce 9800 GX2 1G ddr3 | 2X WD5000AAJS 500Gb Sata 2 | PSU 600W || Caixa El-Diablo | Creative XMod

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.