コード例 #1
0
ファイル: JyUploadImage.cs プロジェクト: arrebagrove/UWP
        private async Task UploadImage(UploadImageTask uploadImageTask)
        {
            //Appid 为静态,有_appid 应用的appid
            //_secretId 九幽的
            ResponseInfo responseInfo;

            if (uploadImageTask.Scale > 0)
            {
                responseInfo = await JyCloudTool.JyCloudTool.sendFileScale(
                    AppId._appId, AppId._secretId, uploadImageTask.File,
                    uploadImageTask.Scale);
            }
            else if ((uploadImageTask.Width > 0) && (uploadImageTask.Height > 0))
            {
                responseInfo = await JyCloudTool.JyCloudTool.sendFileCustom(
                    AppId._appId, AppId._secretId, uploadImageTask.File,
                    (uint)uploadImageTask.Width, (uint)uploadImageTask.Height);
            }
            else
            {
                responseInfo = await JyCloudTool.JyCloudTool.sendFileOriginal(
                    AppId._appId, AppId._secretId, uploadImageTask.File);
            }
            if (responseInfo.respose_Status == 0)
            {
                uploadImageTask.Url = responseInfo.ImgUrl;
                uploadImageTask.OnUploaded?.Invoke(uploadImageTask, true);
            }
            else
            {
                uploadImageTask.OnUploaded?.Invoke(uploadImageTask, false);
            }
        }
コード例 #2
0
 public UploadImageTask(UploadImageTask uploadImageTask)
 {
     File   = uploadImageTask.File;
     Scale  = uploadImageTask.Scale;
     Width  = uploadImageTask.Width;
     Height = uploadImageTask.Height;
     Name   = uploadImageTask.Name;
     Guid   = uploadImageTask.Guid;
 }
コード例 #3
0
ファイル: JyUploadImage.cs プロジェクト: liujingyang/UWP
        private async Task UploadImage(UploadImageTask uploadImageTask)
        {
            //Appid 为静态,有_appid 应用的appid
            //_secretId 九幽的
            var account = AccoutGoverment.AccountModel;

            if (!string.IsNullOrEmpty(account.Account.JiuYouId))
            {
                AppId._appId = account.Account.JiuYouId;
            }

            if (!string.IsNullOrEmpty(account.Account.JiuYouSecretId))
            {
                AppId._secretId = account.Account.JiuYouSecretId;
            }

            ResponseInfo responseInfo;

            if (uploadImageTask.Scale > 0)
            {
                responseInfo = await JyCloudTool.JyCloudTool.sendFileScale(
                    AppId._appId, AppId._secretId, uploadImageTask.File,
                    uploadImageTask.Scale);
            }
            else if ((uploadImageTask.Width > 0) && (uploadImageTask.Height > 0))
            {
                responseInfo = await JyCloudTool.JyCloudTool.sendFileCustom(
                    AppId._appId, AppId._secretId, uploadImageTask.File,
                    (uint)uploadImageTask.Width, (uint)uploadImageTask.Height);
            }
            else
            {
                responseInfo = await JyCloudTool.JyCloudTool.sendFileOriginal(
                    AppId._appId, AppId._secretId, uploadImageTask.File);
            }
            if (responseInfo.respose_Status == 0)
            {
                uploadImageTask.Url = responseInfo.ImgUrl;
                uploadImageTask.OnUploaded?.Invoke(uploadImageTask, true);
            }
            else
            {
                uploadImageTask.OnUploaded?.Invoke(uploadImageTask, false);
            }
        }
コード例 #4
0
ファイル: HeaaxThesolw.cs プロジェクト: ktnhhxh/UWP
        public async Task Jcloud(Action <bool> onUpload)
        {
            ImageShackEnum imageShack = Account.ImageShack;

            if (File.FileType == ".gif" && imageShack == ImageShackEnum.Jiuyou)
            {
                imageShack = ImageShackEnum.Qin;
            }

            var size = (await File.GetBasicPropertiesAsync()).Size;

            //1M
            //1024k
            //‪125000‬
            if (size > 125000)
            {
                imageShack = ImageShackEnum.Smms;
            }
            //4326  24,447

            imageShack = CheckShack(imageShack);

#if DEBUG
            //imageShack = ImageShackEnum.Cimage;
#endif

            UploadImageTask uploadImageTask = NewUploadImageTask(
                imageShack, File);
            uploadImageTask.OnUploaded += (s, e) =>
            {
                if (!(s is UploadImageTask uploadImage))
                {
                    onUpload?.Invoke(false);
                    return;
                }

                Url = uploadImage.Url;

                onUpload?.Invoke(e);
            };
            uploadImageTask.UploadImage();
        }
コード例 #5
0
ファイル: SmmsUploadImage.cs プロジェクト: qiujiafu/UWP
 public SmmsUploadImage(UploadImageTask uploadImageTask)
     : base(uploadImageTask)
 {
 }
コード例 #6
0
ファイル: JyUploadImage.cs プロジェクト: liujingyang/UWP
 public JyUploadImage(UploadImageTask uploadImageTask)
     : base(uploadImageTask)
 {
 }