Constructor does not work the way is should
I am trying to build a multithreaded port scanner this is my first attempt to program in c#. But my OOP knowledge does not really apply to c#. I have this error which probably anyone can solve but me. I get an error "Method name expected" here is the line that causes the error
myThreads[0] =
newThread(newThreadStart(newScanPort("127.0.0.1",idx)));The problem is in the (new ScanPort"127.0.0.1",idx);
idx is an integer and scanport is a public class of mine. Here is my scanport class
publicclassScanPort { String IP;int PORT;public ScanPort(String myip,int myport){ IP = myip; PORT = myport; Scan(); { TcpClient scanningIpPort =newTcpClient();DateTime lStarted =DateTime.Now;try{ scanningIpPort.Connect(IP, PORT); scanningIpPort.Close(); Console.Out.WriteLine("Open " + PORT);} catch{ Console.Out.WriteLine("Closed " + PORT);} }} |
Can anyone please advise me on what to do?
Thank you all happy coding :)
Adam Dallis

