[Help]

Posts 1–12 of 12 · Page 1 of 1
[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...)
Portbug.zipattachment deleted
[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?
[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.
nope, same problem...
Breakpoint the code on the line after

IPport = client.Client.RemoteEndPoint.ToString

and make sure IPport is actually holding the value you expect.
it is......
tostring changes nothing atm..
yay, seems to have worked.
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)
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...
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.
Posts 1–12 of 12 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?