コード例 #1
0
        public Response <XParseDocument> Upload(WebFormDownloadSettings settings)
        {
            AsyncArgs args = new AsyncArgs(null)
            {
                Settings = settings
            };

            if (settings.Account.Crumb == string.Empty)
            {
                Html2XmlDownload html = new Html2XmlDownload();
                html.Settings.Account = settings.Account;
                html.Settings.Url     = settings.Url;
                Response <XParseDocument> resp = html.Download();
                this.ConvertHtml(resp.Result, args);
            }
            PostDataUpload dl = new PostDataUpload();

            this.PrepareDownloader(dl, args);
            if (dl.Settings.PostStringData != string.Empty)
            {
                DefaultResponse <System.IO.Stream> resp = (DefaultResponse <System.IO.Stream>)dl.Download();
                return(resp.CreateNew(MyHelper.ParseXmlDocument(resp.Result)));
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
ファイル: WebFormUpload.cs プロジェクト: sevensky/win8stock
        public void UploadAsync(WebFormDownloadSettings settings, object userArgs)
        {
            AsyncArgs args = new AsyncArgs(userArgs)
            {
                Settings = settings
            };

            if (settings.Account.Crumb == string.Empty)
            {
                Html2XmlDownload html = new Html2XmlDownload();
                html.Settings.Account        = settings.Account;
                html.Settings.Url            = settings.Url;
                html.AsyncDownloadCompleted += this.html_DownloadAsyncCompleted;
                html.DownloadAsync(args);
            }
            else
            {
                this.UploadAsync2(args);
            }
        }