示例#1
0
        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';
        }
示例#2
0
        public static void StartRunner(string args)
        {
            var process = new Process
            {
                StartInfo = new ProcessStartInfo(HttpContext.Current.Server.MapPath("~/plugins/BackgroundRunner.exe"))
                {
                    WorkingDirectory      = HttpContext.Current.Server.MapPath("~/"),
                    RedirectStandardInput = true,
                    UseShellExecute       = false
                }
            };

            process.Start();
            process.StandardInput.WriteLine(Rbase64.Encode(args));
            process.StandardInput.Close();
        }
示例#3
0
        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);
        }
示例#4
0
 public override string ToString()
 {
     return(string.Format("{0},{1},{2}{3}{4}{5}{6}", Password, Rbase64.Encode(Comment),
                          Tf(Browse), Tf(Download), Tf(OperateFiles), Tf(OperateTasks), Tf(Admin)));
 }