title: Get links of a html document in order
body: <p>I want to get all the links of a HTML document. This isn't a problem, but apparently it puts all the links in an alphabetic order before storing them in an array one by one. I want to have the links in original order (not in alphabetic).</p>
  
  <p>So is there any possibility to get the first found link, store it, then the second one,...? I already tried using HtmlAgilityPack and the Webbrowser-Control methods, but both order them alphabetically. The original order is important for later purposes.</p>
  
  <p>I heard that it might be possible with Regex, but I've found enough answers, where they say that you shouldn't use it for HTML parsing. So how can I do it?</p>
  
  <p>Here's the Webbrowser-Control code, I tried to use to get the links and store them into an array:</p>
  
  <pre><code>    private void btnGet_Click(object sender, EventArgs e)
      {
          HtmlWindow mainFrame = webFl.Document.Window.Frames["mainFrame"];
          HtmlElementCollection links = mainFrame.Document.Links;
  
          foreach (HtmlElement link in links)
          {
              string linkText = link.OuterHtml;
              if (linkText.Contains("puzzle"))
              {
                  arr[i] = linkText;
                  i++;
              }
          }
      }
  </code></pre>
  
  <p>Thank you in advance,
  Opak</p>