예제 #1
0
        /// <summary>
        /// Provides the total / free disc size in bytes for your app.
        /// </summary>
        /// <returns></returns>
        public DiscUsage GetDiscUsage()
        {
            try
            {
                StreamReader reader = new StreamReader(Utils.ProcessCommand(Utils.Sign(this.strURIDisc), "GET"));

                string  strJSON    = reader.ReadToEnd();
                JObject parsedJSON = JObject.Parse(strJSON);

                DiscResponse discResponse = JsonConvert.DeserializeObject <DiscResponse>(parsedJSON.ToString());


                return(discResponse.DiscUsage);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #2
0
        /// <summary>
        /// Provides the total / free disc size in bytes for your 3rd party storage.
        /// </summary>
        /// <returns></returns>
        public DiscUsage GetDiscUsage(StorageType storageType, string storageName)
        {
            try
            {
                //Build URI to get disc usage
                StringBuilder strURI = new StringBuilder(this.strURIDisc);

                strURI.Append("?storage=" + storageName);

                StreamReader reader = new StreamReader(Utils.ProcessCommand(Utils.Sign(strURI.ToString()), "GET"));

                string  strJSON    = reader.ReadToEnd();
                JObject parsedJSON = JObject.Parse(strJSON);

                DiscResponse discResponse = JsonConvert.DeserializeObject <DiscResponse>(parsedJSON.ToString());


                return(discResponse.DiscUsage);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }