示例#1
0
        public static Token Upload(string url, byte[] data)
        {
#if DEBUG
            Debug.Assert(!string.IsNullOrEmpty(url));
            Debug.Assert(data != null);
#endif
            var token  = GenerateToken();
            var worker = WebUploadWorker.Create();
            _workers.Add(token, worker);
            worker.Request(url, data, 0, data.Length);
            return(token);
        }
示例#2
0
        public static Token Upload(string url, string targetFile)
        {
#if DEBUG
            Debug.Assert(!string.IsNullOrEmpty(url));
            Debug.Assert(!string.IsNullOrEmpty(targetFile));
#endif
            var token  = GenerateToken();
            var worker = WebUploadWorker.Create();
            _workers.Add(token, worker);
            worker.Request(url, targetFile);
            return(token);
        }