Пример #1
-1
        /// <summary>
        /// Returns a commonly used file extension
        /// </summary>
        /// <returns>A <see cref="string"/></returns>
        public static string CommonFileExt()
        {
            var types = new[]
                {
                    "application/pdf",
                    "audio/mpeg",
                    "audio/wav",
                    "image/png",
                    "image/jpeg",
                    "image/gif",
                    "video/mp4",
                    "video/mpeg",
                    "text/html"
                };

            return FileExt(types[Number.RandomNumber(0, types.Length - 1)]);
        }
Пример #2
-1
        ///// <summary>
        ///// Get a random mime type
        ///// </summary>
        ////public static string MimeType()
        ////{
        ////    return Random.ArrayElement(mimeKeys);
        ////}

        /// <summary>
        /// Returns a commonly used file type
        /// </summary>
        /// <returns>A <see cref="string"/></returns>
        public static string CommonFileType()
        {
            var types = new[] { "video", "audio", "image", "text", "application" };
            return types[Number.RandomNumber(0, types.Length - 1)];
        }