Пример #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);
        }
Пример #3
0
        public static WebUploadWorker Create()
        {
            var worker = new WebUploadWorker();

            return(worker);
        }