Results 1 to 3 of 3

Thread: [RESOLVED] VB.Net Whats an IPAddress(ip,port) supposed to look like?

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Resolved [RESOLVED] VB.Net Whats an IPAddress(ip,port) supposed to look like?

    The underlined code is causing a build error. basically it looks like it expects the ip to be in a different format.

    Any help please.

    VB Code:
    1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         'Put user code to initialize the page here
    3.  
    4.  
    5.        [U] Me.Connect( 82.47.247.163, "Fish paste")[/U]
    6.     End Sub
    7.     Shared Sub Connect(ByVal ip As IPAddress, ByVal message As String)
    8.         Try
    9.             ' Create a TcpClient.
    10.             ' Note, for this client to work you need to have a TcpServer
    11.             ' connected to the same address as specified by the server, port
    12.             ' combination.
    13.  
    14.             Dim port As Int32 = 9100
    15.             Dim client As New TcpClient
    16.             client.Connect(ip, port)

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: VB.Net Whats an IPAddress(ip,port) supposed to look like?

    I don't know what the particular code is expecting, but I'd expect that it wants either a string, Me.Connect( "82.47.247.163", "Fish paste"), or a longint (you'd have to convert the dotted form to the long form).

    Try putting the cursor on IPAddress in the sub declaration and hitting F1 to see what help says an IP address looks like.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: VB.Net Whats an IPAddress(ip,port) supposed to look like?

    Through the F1 method I found this which is obsolete apparently but works.



    VB Code:
    1. Dim ip As IPAddress = IPAddress.Parse("82.47.247.163")
    2.  
    3.         Me.Connect(ip, "Fish paste")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width