one of the way to achieve this is open the com port like
SerialPort com = new SerialPort("com1");
com.Open();
your can loop from i to 250 com port if unsuccessful it will throw exception
and you can handle it.
other wise it will successfully open the port