There is a line:
xmlhttp.open("GET","show_city1.php?state_code="+str,true); You need to pull everything out between: ("GET", "and" +, that is, pull out a piece: show_city1.php?state_code= without extra characters at the beginning and at the end, what approximate patern to use for this? Tell me, please, need a patern under C # ...

new Url("show_city" + city_num + ".aspx").addQuery("state_code", str). Your approach to the problem (“pull the text out of the html page”) is basically wrong. And yes, this cannot be a real task. This is part of your approach to solving a bigger problem. - VladD