public User(string value) { var columns = value.Split(','); Password = columns[0]; Comment = Rbase64.Decode(columns[1]); Browse = columns[2][0] == 'T'; Download = columns[2][1] == 'T'; OperateTasks = (OperateFiles = columns[2][2] == 'T') && columns[2][3] == 'T'; Admin = columns[2][4] == 'T'; }
private void NiGuan(string path, XContainer result) { Response.Write("<!-- Processing"); Response.Flush(); var url = Rbase64.Decode(Request.QueryString["Url"].UrlDecode()); if (string.IsNullOrWhiteSpace(url)) { return; } foreach (var video in Net.YouTube.Video.GetVideoFromLink(url)) { var element = new XElement("video", new XAttribute("title", video.Title), new XAttribute("url", video.Url), new XAttribute("author", video.Author), new XAttribute("keywords", string.Join(", ", video.Keywords)), new XAttribute("rating", video.AverageRating), new XAttribute("viewCount", video.ViewCount), new XAttribute("uploadTime", video.UploadTime.Ticks), new XAttribute("length", video.Length)); foreach (var link in video.Downloads) { var e = new XElement("download", new XAttribute("type", link.ToString()), new XAttribute("information", link.Properties)); if (link.UrlUnavailableException == null) { e.SetAttributeValue("link", string.Format("{0}://{1}/Task/Create/Offline/{2}?Url={3}", Request.Url.Scheme, Request.Url.Host, FileHelper.Combine(path, (link.Parent.Title + link.Extension) .ToValidPath()), Rbase64.Encode(link.GetUrl(link.Parent.Title)))); } element.Add(e); } result.Add(element); Response.Write('.'); // prevent the thread from getting killed, how evil I am MUAHAHA Response.Flush(); } Response.Write(" -->" + Environment.NewLine); }