Exemple #1
0
        /// <summary>
        /// 1. Get the document
        /// 2. find the formular specified by formular.Name (currently only Html supported)
        /// 3. fill the formular from the document with the additional/overwrite parameters
        /// 3. submit the formular
        /// </summary>
        private Uri SubmitFormular(Uri url, Formular formular)
        {
            using (var loader = new WinFormHtmlDocumentLoader())
            {
                var document = loader.LoadHtmlDocument(url);
                var htmlForm = new Html.WinForms.HtmlDocumentAdapter(document).GetFormByName(formular.Name);
                if (htmlForm == null)
                {
                    return(null);
                }

                var formSubmitUrl = htmlForm.CreateSubmitUrl(formular);

                return(SendRequest(formSubmitUrl));
            }
        }
Exemple #2
0
        /// <summary>
        /// 1. Get the document
        /// 2. find the formular specified by formular.Name (currently only Html supported)
        /// 3. fill the formular from the document with the additional/overwrite parameters
        /// 3. submit the formular
        /// </summary>
        private Uri SubmitFormular( Uri url, Formular formular )
        {
            using ( var loader = new WinFormHtmlDocumentLoader() )
            {
                var document = loader.LoadHtmlDocument( url );
                var htmlForm = new Html.WinForms.HtmlDocumentAdapter( document ).GetFormByName( formular.Name );
                if ( htmlForm == null )
                {
                    return null;
                }

                var formSubmitUrl = htmlForm.CreateSubmitUrl( formular );

                return SendRequest( formSubmitUrl );
            }
        }