fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6. using System.Text.RegularExpressions;
  7.  
  8. namespace _2chBrowser
  9. {
  10. class ResInfo
  11. {
  12. public string Name { get; set; }
  13. public string Mail { get; set; }
  14. public string Date { get; set; }
  15. public string Id { get; set; }
  16. public string BeId { get; set; }
  17. public string Text { get; set; }
  18.  
  19. public ResInfo(string name, string mail, string date, string id, string beid, string text)
  20. {
  21. this.Name = name;
  22. this.Mail = mail;
  23. this.Date = date;
  24. this.Id = id;
  25. this.BeId = beid;
  26. this.Text = text;
  27. }
  28.  
  29. public static List<ResInfo> CreateList(string sureAllText)
  30. {
  31. const string Ptn = @"^(?<name>[^<]+)<>(?<mail>[^<]*)<>(?<date>.*) ID:(?<id>[^<]*)<>(?<text>.*)$";
  32.  
  33. List<ResInfo> list = new List<ResInfo>();
  34.  
  35. TextReader tr = (new StringReader(sureAllText));
  36. while (0 < tr.Peek())
  37. {
  38. string s = tr.ReadLine();
  39. var mch = Regex.Match(s, Ptn);
  40. if (mch.Success)
  41. {
  42. string name = mch.Groups["name"].Value;
  43. string mail = mch.Groups["mail"].Value;
  44. string date = mch.Groups["date"].Value;
  45. string id = mch.Groups["id"].Value;
  46. string text = mch.Groups["text"].Value;
  47. var item = new ResInfo(name, mail, date, id, "", text);
  48. list.Add(item);
  49. }
  50.  
  51. }
  52. return list;
  53. }
  54. }
  55. }
  56.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
error CS5001: Program `prog.exe' does not contain a static `Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty