コード例 #1
0
        public virtual void Push(Guid[] devices, params object[] objs)
        {
            String vpath = this.Provider["authkey"];

            if (String.IsNullOrEmpty(vpath) == false && devices.Length > 0 && objs.Length > 0)
            {
                String sts = String.Format("https://ali.365lu.cn/OSS/Push/{0}", this.Provider["authkey"]);


                var httpClient = new UMC.Net.HttpClient();
                var res        = httpClient.PostAsync(sts, new System.Net.Http.StringContent(JSON.Serialize(new Web.WebMeta().Put("device", devices).Put("data", objs)))).Result;
            }
        }
コード例 #2
0
        public virtual void Transfer(Uri uri, Guid guid, int seq, string type)
        {
            String vpath = this.Provider["authkey"];

            if (String.IsNullOrEmpty(vpath) == false)
            {
                String code = Utility.ParseEncode(Utility.Guid(vpath).GetHashCode(), 36);
                vpath = code + "/";


                String key = String.Format("{0}images/{1}/{2}/{3}.{4}", vpath, guid, seq, 0, type.ToLower());


                String sts = String.Format("https://ali.365lu.cn/OSS/Transfer/{0}", this.Provider["authkey"]);


                var httpClient = new UMC.Net.HttpClient();
                var res        = httpClient.PostAsync(sts, new System.Net.Http.StringContent(JSON.Serialize(new Web.WebMeta().Put("src", uri.AbsoluteUri, "key", key)))).Result;
            }
        }