Thanks to Tina.
My applicaion can create all the 500 ports successfully if I wait for enough time until all ports are removed.But the waiting time is about 30 minutes,it is too long. And if I want to create more ports such as 1024,I can not imagine how long it will takes.
Actually,Not only the deletion time is long,but the creation time of 500 ports is about 15 minutes,I thinks it is also too long for me.
You mean that the time is dependent on the windows system,and my system is Windows XP with Intel Dual-Core E2140 CPU,1GB Memory.I think it is not very bad.
Would you please tell me is there any way to improve the speed of the COM ports creation and deletion?