Пример #1
0
        public static string[] DownloadGeneric(string cmd, string sender, MatrixRoom room)
        {
            Uri uri;

            if (!Uri.TryCreate(cmd, UriKind.Absolute, out uri))
            {
                throw new Exception("Not a url :(");
            }
            FileInfo info     = new FileInfo(uri.Segments.Last());
            string   filename = Convert.ToBase64String(Encoding.UTF8.GetBytes(info.Name)) + info.Extension;

            Downloaders.GenericDownload(cmd, filename);
            return(new string[2] {
                filename, uri.Segments.Last()
            });
        }