Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm just going to throw this out there as a pretty crude solution to your immediate issue, which I understand to be a need to retrieve a list of available update files from a web page. Hopefully it helps a bit.</p> <p>As I don't have access to your company's updates page I'm going to use a page on Project Gutenburg which lists Children's Anthologies and grab all the links from that instead</p> <p>The first thing to do is to grab the source code for the page into a string I'm calling <code>source</code>.</p> <pre><code>WebClient client = new WebClient(); String source = client.DownloadString(@"http://www.gutenberg.org/wiki/Children%27s_Anthologies_(Bookshelf)"); </code></pre> <p>Then everything after that is just the same as programming for the desktop. <code>source</code> is just a piece of text to be parsed. In case you are unfamiliar, links in HTML are written <code>&lt;a href="linkgoeshere"&gt;textgoeshere&lt;/a&gt;</code> and because we're looking for that specific pattern we can just rip all the links out with Regex.</p> <pre><code>Regex regex = new Regex("href=\"(http://[^\"]+)\"", RegexOptions.IgnoreCase | RegexOptions.Multiline ); var matches = regex.Matches(source); foreach (Match match in matches) { Console.WriteLine(match.Groups[1].Value); } </code></pre> <p>That code will output all the links on the page. With a bit of luck the files on your update page links to will be direct links that end in .hex, which makes your Regex easier to target, and then you can sort them as required and use the latest link to grab the file as required.</p> <p>EDIT: Incidentally, some links are written with <code>&lt;a href='linkgoeshere'&gt;textgoeshere&lt;/a&gt;</code> with a <code>'</code> rather than a <code>"</code>, also sometimes there is more info crammed in between the angle brackets, but your URL should always be directly after the <code>href=["']</code> part.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload