Пример #1
0
 /// <summary>
 /// 使用browser访问url链接,将结果存在GeckoWebBrowser的Response里
 /// </summary>
 /// <param name="browser"></param>
 /// <param name="url"></param>
 public static String BrowserGet(GeckoWebBrowser browser, String url)
 {
     //var response = GeckoRequestProcessor.DoRequest(CrawlRequest.BuildRequest(url), null, null, null, specifiedBrowser: browser);
     //browser.Response = response;
     //return response.Content;
     return (String)browser.Invoke(new GeckoOperationOne<String>(GeckoGet), browser, url);
 }
Пример #2
0
 /// <summary>
 /// 使用browser向地址url发送数据data,将返回结果放在GeckoWebBrowser的Response里
 /// </summary>
 /// <param name="browser"></param>
 /// <param name="url"></param>
 /// <param name="data"></param>
 public static String BrowserPost(GeckoWebBrowser browser, String url, String data)
 {
     //CrawlRequest request = CrawlRequest.BuildRequest(url);
     //request.PostData = data;
     //var response = GeckoRequestProcessor.DoRequest(request, null, null, null, specifiedBrowser: browser);
     //browser.Response = response;
     //return response.Content;
     return (String)browser.Invoke(new GeckoOperationTwo<String>(GeckoPost), browser, url, data);
 }
Пример #3
0
 /// <summary>
 /// 把browser当前document里locator所指向的元素设置成focus状态
 /// </summary>
 /// <param name="browser"></param>
 /// <param name="locator"></param>
 public static Boolean OperateBrowserSetFocus(GeckoWebBrowser browser, DomElementLocator locator)
 {
     return (Boolean)browser.Invoke(new GeckoOperationOne<Boolean>(GeckoFocus), browser, locator);
 }
Пример #4
0
 /// <summary>
 /// 对browser当前document里locator所指向的元素填入数据inputValue
 /// </summary>
 /// <param name="browser"></param>
 /// <param name="locator"></param>
 /// <param name="inputValue"></param>
 public static Boolean OperateBrowserInput(GeckoWebBrowser browser, DomElementLocator locator, String inputValue)
 {
     return (Boolean)browser.Invoke(new GeckoOperationTwo<Boolean>(GeckoInput), browser, locator, inputValue);
 }