Thread: [Help]

Results 1 to 12 of 12
  1. #1
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid

    [Help]

    i thought about it, and without help from my other thread, mainly becouse nobody knows what the poblem is, im going to give my beta program out, and if people want to help, and have a disassembler, you can have a look at the code. (besides what i'll post)

    what this program is ment to be doing is scanning over all the ip connections to the set IP address, and if it matchs the port enterd, saves it and displays it in the console.

    Code:
       
     'my.settings.portno = console.readline() -------from main module
    IPport = client.Client.RemoteEndPoint.ToString
                'Splits the ip and port to two different instances
                ipport.Split(":"c)
                Dim port As String = ipport(1)
                Dim ip As String = ipport(0)
                ipname = ipport(0)
                check = 0
                If port = My.Settings.portno Then
                    Console.WriteLine("Connection Established with : " & ip)
                Else
                    Console.WriteLine(current)
                    Console.WriteLine(port & "---" & ip)
                    Console.WriteLine("Rand = " & ip & ";" & port)
                End If


    the problem is the hole receiving part where i need to split a string.
    any help would be of use.
    and if you want to refine code, be my guest....im sort of new to this peticular kind of coding....sockets and such...

    virus scan
    (my other 2 scan sites are ether overloaded atm or having a server crash...)

  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [highlight="VB.Net"] 'my.settings.portno = console.readline() -------from main module
    IPport = client.Client.RemoteEndPoint.ToString
    'Splits the ip and port to two different instances
    Dim ipsplit() as String = ipport.Split(":"c)
    Dim port As Integer = ipsplit(1)
    Dim ip As String = ipsplit(0)
    ipname = ipport(0)
    check = 0
    If port = My.Settings.portno Then
    Console.WriteLine("Connection Established with : " & ip)
    Else
    Console.WriteLine(current)
    Console.WriteLine(String.Concat(port , "---" , ip))
    Console.WriteLine(String.Concat("Rand = " , ip , ";" , port))
    End If[/highlight]

    Maybe that changes anything?



  3. #3
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid
    nope, same problem...

  4. #4
    Functional's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    48
    Reputation
    17
    Thanks
    19
    My Mood
    Bashful
    Breakpoint the code on the line after

    IPport = client.Client.RemoteEndPoint.ToString

    and make sure IPport is actually holding the value you expect.

  5. #5
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid
    it is......

  6. #6
    ³²³'s Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    sef
    Posts
    302
    Reputation
    9
    Thanks
    19
    My Mood
    Angelic
    remove ToString?

  7. #7
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid
    tostring changes nothing atm..

  8. #8
    Functional's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    48
    Reputation
    17
    Thanks
    19
    My Mood
    Bashful
    [highlight=vb.net]

    IPport = client.Client.RemoteEndPoint.ToString

    Dim ipSplit as String() = ipport.Split(":"c)
    Dim port As Integer = Integer.Parse(ipSplit(1))
    Dim ip As String = ipSplit(0)
    check = 0
    If port = My.Settings.portno Then
    Console.WriteLine("Connection Established with : " & ip)
    Else
    Console.WriteLine(current)
    Console.WriteLine(String.Concat(port , "---" , ip))
    Console.WriteLine(String.Concat("Rand = " , ip , ";" , port))
    End If
    [/highlight]

    Give that a whirl.

  9. The Following User Says Thank You to Functional For This Useful Post:

    sythe179 (04-10-2011)

  10. #9
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid
    yay, seems to have worked.

  11. #10
    Functional's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    48
    Reputation
    17
    Thanks
    19
    My Mood
    Bashful
    Yeah I looked at Blubb1337's and it was essentially right he just made a mistake on line 7 'cos he's a choob (I'll still be your parser/water boi tho <3)

  12. #11
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid
    k, any way of making that code smaller, but still do the same thing?..
    trying to make this program as small as possible...
    hence the console instead of a gui...

  13. #12
    Functional's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    48
    Reputation
    17
    Thanks
    19
    My Mood
    Bashful
    Quote Originally Posted by *****179 View Post
    k, any way of making that code smaller, but still do the same thing?..
    trying to make this program as small as possible...
    hence the console instead of a gui...
    Less lines of code = sweet fuck all. Noone sees it, and if it's cleaner it's much better to have a few extra lines.