public void AutoComplete()
 {
     if (CanAutoComplete)
     {
         StoredSite form = StoredSite.GetStoredSite(this.Url.Host);
         form.FillWebPage(this.Document, true);
     }
 }
        protected override void OnDocumentCompleted(WebBrowserDocumentCompletedEventArgs e)
        {
            // Check whether the current page has been stored.
            StoredSite form = StoredSite.GetStoredSite(this.Url.Host);

            CanAutoComplete = form != null &&
                              form.Urls.Contains(this.Url.AbsolutePath.ToLower());

            base.OnDocumentCompleted(e);
        }
Esempio n. 3
0
        protected override void OnDocumentCompleted(WebBrowserDocumentCompletedEventArgs e)
        {
            // 检查当前页是否被保存。
            StoredSite form = StoredSite.GetStoredSite(this.Url.Host);

            CanAutoComplete = form != null &&
                              form.Urls.Contains(this.Url.AbsolutePath.ToLower());

            base.OnDocumentCompleted(e);
        }
Esempio n. 4
0
        /// <summary>
        ///通过宿主名得到一个存储站点
        /// </summary>
        public static StoredSite GetStoredSite(string host)
        {
            StoredSite storedForm = null;

            string folderPath = string.Format(@"{0}\StoredSites\",
                                              Environment.CurrentDirectory);

            if (!Directory.Exists(folderPath))
            {
                Directory.CreateDirectory(folderPath);
            }

            string filepath = string.Format(@"{0}\{1}.xml", folderPath, host);

            if (File.Exists(filepath))
            {
                storedForm =
                    XMLSerialization <StoredSite> .DeserializeFromXMLToObject(filepath);
            }
            return(storedForm);
        }