/// <summary>
        /// 制作远程缩略图
        /// </summary>
        /// <param name="url">图片url</param>
        /// <param name="newfilename">新图路径</param>
        /// <param name="maxwidth">最大宽度</param>
        /// <param name="maxheight">最大高度</param>
        public static void makeremotethumbnailimage(string url, string newfilename, int maxwidth, int maxheight)
        {
            stream stream = getremoteimage(url);
            if(stream == null)
                return;
            image original = image.fromstream(stream);
            stream.close();
            makethumbnailimage(original, newfilename, maxwidth, maxheight);
        }

        /// <summary>
        /// 获取图片流
        /// </summary>
        /// <param name="url">图片url</param>
        /// <returns></returns>
        private static stream getremoteimage(string url)
        {
            httpwebrequest request = (httpwebrequest)httpwebrequest.create(url);
            request.method = "get";
            request.contentlength = 0;
            request.timeout = 20000;
            httpwebresponse response = null;

            try
            {
                response = (httpwebresponse)request.getresponse();
                return response.getresponsestream();
            }
            catch
            {
                return null;
            }
        }