简体   繁体   中英

Import/Read Combobox List from Web site and use in C# Combobox

I wish to read the two Combobox lists from this site: http://coinmill.com/

Then I wish to recreate that in C# 2010 Combobox.

Thank you.

Use the HtmlAgilityPack to download and parse the page at coinmill. Write an xpath expression or traverse the DOM to find the select tag you´re looking for in the HtmlAgilityPack document. Get the list of options, and load them into your list. Mind you: this code can (and probably will) break every time coinmill updates their website. Your xpath or dom traversing is basing itself on the current layout of that page, and it will change. You would be better off looking for a webservice that offers the data you are looking for.

Menno

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM