示例#1
0
        public static bool ContentTypeIsBinary(HttpHeader.HttpContentType theType)
        {
            HttpHeader.HttpContentType[] binaryTypes = new HttpHeader.HttpContentType[] {
                HttpHeader.HttpContentType.AUDIOMP3,
                HttpHeader.HttpContentType.AUDIOMP4,
                HttpHeader.HttpContentType.AUDIOOGG,
                HttpHeader.HttpContentType.AUDIOWAV,
                HttpHeader.HttpContentType.AUDIOWEBM,
                HttpHeader.HttpContentType.VIDEOMP4,
                HttpHeader.HttpContentType.VIDEOOGG,
                HttpHeader.HttpContentType.VIDEOWEBM,
            };

            foreach (HttpHeader.HttpContentType type in binaryTypes)
            {
                if (theType == type)
                {
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        public static bool ContentTypeIsBinary(HttpHeader.HttpContentType theType)
        {
            HttpHeader.HttpContentType[] binaryTypes = new HttpHeader.HttpContentType[]
            {
                HttpHeader.HttpContentType.AUDIOMP3,
                HttpHeader.HttpContentType.AUDIOMP4,
                HttpHeader.HttpContentType.AUDIOOGG,
                HttpHeader.HttpContentType.AUDIOWAV,
                HttpHeader.HttpContentType.AUDIOWEBM,
                HttpHeader.HttpContentType.VIDEOMP4,
                HttpHeader.HttpContentType.VIDEOOGG,
                HttpHeader.HttpContentType.VIDEOWEBM,
            };

            foreach (HttpHeader.HttpContentType type in binaryTypes)
            {
                if (theType == type)
                {
                    return true;
                }
            }

            return false;
        }