- foreach (var item in items.SearchQuery(textBox1.Text, 1))
- {
- Video video = new Video();
- video.Url = item.Url;
- list.Add(video);
- using (var client = new WebClient())
- {
- var html = client.DownloadString(video.Url);
-
- var htmlDoc = new HtmlAgilityPack.HtmlDocument();
- htmlDoc.LoadHtml(html);
- var htmlElement = htmlDoc.DocumentNode.Element("meta");
- HtmlNode mdnode =
- htmlDoc.DocumentNode.SelectSingleNode("//meta[@name='keywords']");
- var htmlAtribute = mdnode.Attributes["content"];
- string fulldescription = htmlAtribute.Value;
- byte[] bytes = Encoding.Default.GetBytes(fulldescription);
- fulldescription = Encoding.UTF8.GetString(bytes);
- string text = fulldescription;
- Collection<string> collection = new Collection<string>();
- string[] bits = text.Split(',');
- foreach (string rr in bits)
- {
- collection.Add(rr);
- }
- var sortedElements = from rr in collection
- orderby rr.Length descending
- select rr;
- foreach (string c in sortedElements)
- {
- listbox1.Items.Add(c);
- }
- }
- }
- }
The Output :( As you can see , it is ordering part by part, but i want full order which should includes all items in the listbox