daily pastebin goal
94%
SHARE
TWEET

Untitled

a guest Nov 25th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void LoadFields(string fields)
  2.     {
  3.       try
  4.       {
  5.         Regex regexObj = new Regex("class=\"caption\">(?<name>.*?):</span>.*?\"output\">(?<value>.*?)</", RegexOptions.Singleline);
  6.         Match matchResults = regexObj.Match(fields);
  7.         while (matchResults.Success)
  8.         {
  9.           switch (matchResults.Groups["name"].Value)
  10.           {
  11.             case "Hits":
  12.               Hits = matchResults.Groups["value"].Value;
  13.               break;
  14.             case "Votes":
  15.               Votes = matchResults.Groups["value"].Value;
  16.               break;
  17.             case "Date Added":
  18.               DateAdded = matchResults.Groups["value"].Value;
  19.               break;
  20.             case "Last Update":
  21.               DateUpdated = matchResults.Groups["value"].Value;
  22.               break;
  23.             case "Status":
  24.               Status = matchResults.Groups["value"].Value;
  25.               break;
  26.             case "Version":
  27.               Version = matchResults.Groups["value"].Value;
  28.               break;
  29.           }
  30.           matchResults = matchResults.NextMatch();
  31.         }
  32.       }
RAW Paste Data
Top