Constructor does not work the way is should

Hi guys,
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();
}

publicvoid 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

[3431 byte] By [Adam24] at [2007-12-16]
# 1
Hi,
The ThreadStart() constructor takes in a delegate not an object.
Here's a document and a sample.
http://msdn2.microsoft.com/library/57s77029(en-us,vs.80).aspx

cheers,
Paul June A. Domag

PaulDomag at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...