从DCRM 2011将压缩的图像上载到Sharepoint服务器 [英] Uploading compressed Images to Sharepoint server from DCRM 2011

查看:155
本文介绍了从DCRM 2011将压缩的图像上载到Sharepoint服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何压缩图像,然后将图像从我的DCRM 2011上传到SharePoint Server.

谢谢,

Vishal

How to compress and then upload an image from my DCRM 2011 to SharePoint Server.

Thanks,

Vishal

推荐答案

.NET框架具有System.IO.Compression命名空间以执行内置操作.压缩方法将,

.NET framework has System.IO.Compression namespace to perform the built-in operation. Compression method will be,

public static void Compress(FileInfo fi)
{
    using (FileStream inFile = fi.OpenRead())
    {
        if ((File.GetAttributes(fi.FullName)
            & FileAttributes.Hidden)
            != FileAttributes.Hidden & fi.Extension != ".gz")
        {
            using (FileStream outFile =
                        File.Create(fi.FullName + ".gz"))
            {
                using (GZipStream Compress =
                    new GZipStream(outFile,
                    CompressionMode.Compress))
                {
                inFile.CopyTo(Compress);
                }
            }
        }
    }


这篇关于从DCRM 2011将压缩的图像上载到Sharepoint服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆