コード例 #1
0
ファイル: QiniuFile.cs プロジェクト: 15831944/winform-1
        /// <summary>
        /// Delete the QiniuFile with mac.
        /// </summary>
        /// <param name="mac">Mac.</param>
        public bool Delete(MAC mac = null)
        {
            if (mac == null)
            {
                mac = new MAC();
            }
            string url = string.Format("{0}/{1}/{2}", Config.RS_HOST, "delete", Base64URLSafe.Encode(this.bucketName + ":" + this.key));

            try {
                using (QiniuWebClient client = new QiniuWebClient()) {
                    client.Call(url, mac);
                    return(true);
                }
            } catch (WebException e) {
                throw new QiniuWebException(e);
            } catch (Exception e) {
                throw e;
            }
        }
コード例 #2
0
ファイル: QiniuFile.cs プロジェクト: 15831944/winform-1
        /// <summary>
        /// Stat the QiniuFile with mac.
        /// </summary>
        /// <param name="mac">Mac.</param>
        public QiniuFileInfo Stat(MAC mac = null)
        {
            if (mac == null)
            {
                mac = new MAC();
            }
            string url = string.Format("{0}/{1}/{2}", Config.RS_HOST, "stat", Base64URLSafe.Encode(this.bucketName + ":" + this.key));

            try {
                using (QiniuWebClient client = new QiniuWebClient()) {
                    string result = client.Call(url, mac);
                    return(GetQiniuEntry(result));
                }
            } catch (WebException e) {
                throw new QiniuWebException(e);
            }catch (Exception e) {
                throw e;
            }
        }