コード例 #1
0
ファイル: VgymeUploader.cs プロジェクト: andre-d/ShareXYZ
        public override UploadResult Upload(Stream stream, string fileName)
        {
            UploadResult result = UploadData(stream, "http://vgy.me/upload", fileName);

            if (result.IsSuccess)
            {
                VgymeResponse response = JsonConvert.DeserializeObject <VgymeResponse>(result.Response);

                if (response != null && !response.Error)
                {
                    result.URL         = response.Image;
                    result.DeletionURL = response.Delete;
                }
            }

            return(result);
        }
コード例 #2
0
ファイル: VgymeUploader.cs プロジェクト: nagyist/ShareX
        public override UploadResult Upload(Stream stream, string fileName)
        {
            Dictionary <string, string> arguments = new Dictionary <string, string>();

            if (!string.IsNullOrEmpty(UserKey))
            {
                arguments.Add("userkey", UserKey);
            }

            UploadResult result = UploadData(stream, "https://vgy.me/upload", fileName, arguments: arguments);

            if (result.IsSuccess)
            {
                VgymeResponse response = JsonConvert.DeserializeObject <VgymeResponse>(result.Response);

                if (response != null && !response.Error)
                {
                    result.URL         = response.Image;
                    result.DeletionURL = response.Delete;
                }
            }

            return(result);
        }