Once the child is born, you can file a paternity petition in Family Court. Until then there is nothing you can do. There is a presumption that any child born during a marriage is the child of the husband. You have the burden of proving that the child is yours - which means filing a petition and asking for genetic testing. You must do this right after the birth, however. If you wait too long, the court may not allow you to have testing, and then you will not have any parental rights.
You can petition in Family Court for a dna test. If you are the father you may have to pay child support.
I am a former federal and State prosecutor and have been doing criminal defense work for over 17 years. I was named to the Super Lawyers list as one of the top attorneys in New York for 2012 and 2013. No more than 5 percent of the lawyers in the state are selected by Super Lawyers. Martindale-Hubbell has given me its highest rating - AV Preeminent - in the areas of Criminal Law, Personal Injury, and Litigation. According to Martindale-Hubbell”AV Preeminent is a significant rating accomplishment - a testament to the fact that a lawyer's peers rank him or her at the highest level of professional excellence." Fewer than 8% of attorneys achieve an AV Preeminent rating. I also have the highest ranking – “superb” – on Avvo. The above answer, and any follow up comments or emails is for informational purposes only and not meant as legal advice.