DELPHI如何利用BHO更改网页内容

Delphi 10.4.1 EdgeBrowser 模拟操作网页方法 Delphi 10.4.1 EdgeBrowser 模拟操作网页方法 以往一直用TWebBrowser 或者 C++ Builder 中的TCcpWebBrowser来写网页模拟操作 这两个控件可以使用WebBrowser.OleObject.document、WebBrowser.Document As IHTMLDocument2来实现大部分的操作 发现这两者都是依赖于IE内核,虽然可以设定IE 11内核,但是今年微软公布11月底停止更新了 所以可以考虑使用微软推出的Edge浏览器 进入正题: Delp 阅读详情

DELPHI如何利用BHO更改网页内容?
下面是左轻候的一段代码

//第一个例程
//实现内容
procedure Tform1.ShowHTML(src:string;iebrw:TEmbeddedWB;ID:integer);
var
    vv: Variant;
    HTMLDocument: IHTMLDocument2; 
    tmpStr,tmpfilepath:string;0D
begin
   //直接写到浏览器里。
   vv := VarArrayCreate([0,0],varVariant); 
   vv[0] := '<base href="'+LocalPath+'"/>'+ src+ tmpStr; 
   try
      ieBrw.Navigate('about:blank'); //这里必须要
      HTMLDocument := iebrw.Document as IHTMLDocument2; 
      HTMLDocument.write(PSafeArray(TVarData(vv).VArray)); 
      HTMLDocument.charset:3D 'gb2312'; 
      HTMLDocument.close;
   except 
      statusbar1.Panels[0].Text:='写浏览器出错';
   end;
   HtmlDocument:=nil;
end;

//第二个例程
procedure WB_LoadHTML(WebBrowser: TWebBrowser; HTMLCode: string);
var
   sl: TStringList;
   ms: TMemoryStream;
begin
   WebBrowser.Navigate('about:blank');
   if Assigned(WebBrowser.Document) then
   begin
      sl := TStringList.Create;
       try 
          ms := TMemoryStream.Create;
          try
             sl.Text := HTMLCode; 
             sl.SaveToStream(ms);  
              ms.Seek(0, 0);
              (WebBrowser.Document as IPersistStreamInit).Load(TStreamAdapter.Create(ms)); 
          finally
             ms.Free;
          end;
      finally
        sl.Free;
     end;
    end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
WB_LoadHTML(WebBrowser1,'<html><body bgcolor="#0099FF">SwissDelphiCenter</html>');
end;

 

width="468" height="60" frameborder="0" align="middle" border="0" marginheight="1" marginwidth="1" src="http://b199.cn/blog_ads/Google_468_60.htm" name="I1">

Delphi实现IE浏览器自定义图标添加教程 本文还有配套的精品资源,点击获取 简介:本教程旨在指导开发者如何使用Delphi开发工具在IE浏览器的标准按钮栏中添加自定义图标。教程详细介绍了IE浏览器的扩展机制,包括BHO和Toolbar Band Objects的使用,Delphi项目的创建和配置,BHO的实现与注册,以及如何将自定义工具栏和图标添加到IE的侧边栏。此外,教程还涵盖了如何处理按钮事件以及部署和注意事项... 阅读详情

相关推荐

BHO实现拦截IE地址,URL重定向

BHO实现拦截IE地址,URL重定向,比如输入baidu.com,跳转到hao123.网上的例子都不全,我这个是完全可以运行的

webbrowser设置html内容,delphi 修改WebBrowser的内容

很多方法都可以修改WebBrowser的内容。比如说修改innerHTML、以流方式修改。以流方式就不说了,网上很多代码。直接修改innerHTML的方法很简单,但是有个缺点,修改后没保存,最近在做一个小东西,需要在WebBrowser编辑模式和浏览模式中切换,直接修改innerHTML的问题是,切换之后修改的数据丢失了。另一种修改方法,利用IHTMLDocument2的write方法写入:pro...

weixin_42691065的博客 543

DEPHI BHO源程序

DEPHI BHO源程序 DEPHI BHO源程序 DEPHI BHO源程序

网页代码string转HtmlDocument

用webbrowser HtmlDocument String2Html(string htmlString) { WebBrowser getInfoWebBrowser = new WebBrowser(); getInfoWebBrowser.ScriptErrorsSuppressed = true;

ccfyzh的专栏 1385

delphi开发的 BHO ie插件

delphi开发的 BHO ie插件,请阅!

delphi BHO源码

delphi实现的bho源码,包含(IE工具栏、IE图标、IE右键菜单、IE钩子)

delphi 读取IE加载项的注册表项

BHO(浏览器辅助插件) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects

estly的专栏 399

Delphi BHO

用delphi写的bho,能用,只是代码有点简单。

用Delphi动态改变页面内容

使用TWebBrowser组件可以直接显示网页的内容, 因此在用delphi开发程序时,我们可以使用TWebBrowser来展示一些数据,获得更美观专业的效果,提高应用程序的挡次。    通常的做法时,做一些静态的页面,TWebBrowser装载这些页面后,再通过delphi填写数据。故需要用到的技术就是如何通过delphi读取或者控制TWebBrowser中内容。其实TWebBrowser就是一

PuCooV的天空 1092

ProjectIEBar BHO Delphi

ProjectIEBar BHO Delphi

如何设置IE BHO在Visual Studio中的调试步骤

图文描述C#开发BHO时如何如何对BHO代码进行调试,跟踪断点

Delphi中Chrome Chromium获取元素的方法

一、遍历网页元素并点击JS: 转载请注明出处,原文地址: http://blog.csdn.net/xtfnpgy/article/details/48155323 1.遍历所有元素 var eles=document.all; for(var i=0;i<eles.length;i++){var a; var d=eles[i]; var s=eles[i].getAttribute("class"); if(s!=null){ ...

wjw806[旺旺]的专栏 2842

Open5GS实战指南:Ubuntu 22.04环境下的5G核心网快速部署

本文提供Open5GS在Ubuntu 22.04环境下部署5G核心网的实战指南,涵盖环境准备、MongoDB配置、核心组件安装、WebUI部署及网络调优等关键步骤。通过详细的安装教程和常见问题解决方案,帮助开发者快速搭建开源5G核心网测试环境。

weixin_29202213的博客 548

再谈 Delphi 的 LiveBindings 绑定界面元素和对象

前言: 本博客前面有文章描述过如何将一个对象的属性和界面元素(比如,Label1)绑定。那篇文章写得有点复杂。这里简化一下操作过程的描述。 Delphi 版本: Delphi 10.4 社区版。 操作方法: 1. 假设有一个类定义: TMyDev = class private FDevID: string; FDevName: string; FIsOnline: Integer; FIsSelected: Integer; public pr

pcplayer的博客 1404

ROS2 Nav2实战:解决rviz2显示no map received的3种实用方法(附详细步骤)

本文针对ROS2 Nav2导航栈中rviz2显示“no map received”的常见问题,提供了三种核心解决方案。深入剖析了问题根源在于ROS2生命周期节点管理、QoS策略不匹配及坐标系设置错误,并分别通过手动配置流程、集成生命周期管理器以及调优QoS策略与固化rviz2配置,给出了详细的实战步骤,确保地图数据可靠显示。

j0k1l2m3n的博客 431

用Python玩转Milvus:从安装SDK到完成第一个向量搜索Demo

本文为Python开发者提供了一份详细的Milvus向量数据库实战指南。文章重点讲解了如何规避版本兼容性陷阱,正确部署Milvus服务端并安装匹配的Python SDK。通过一个电影推荐系统的完整案例,演示了从数据建模、集合创建、向量插入、索引构建到执行混合搜索的全流程,帮助开发者快速上手并完成第一个向量搜索Demo。

weixin_29239279的博客 197

IHTMLDocument2的所有成员、属性、方法、事件

IHTMLDocument2 Interface Gets information about the document, and examines and modifies the HTML elements and text in the document. IHTMLDocument2 Members activeElement Gets the object that...

架构设计 377

2021-10-29 atcoder ABC157——B - Bingo

B - Bingo 先标记,然后暴力判断,这样最清晰最好想。 #include<iostream> #include<algorithm> #include<cstring> using namespace std; typedef long long LL; int a[110][110],b[110]; int main() { for(int i=1;i<=3;i++) for(int j=1;j<=3;j++) cin>>a[i]

honeistbutter的博客 347

delphi 遍历网页中的图片

var doc: IHtmlDocument2; i: Integer; s: String;begin //iFile := WebBrowser1.Document as IPersistFile; //iFile.Save('F:\tt.mht', False); doc := WebBrowser1.Document as IHtmlDocument2; if ...

weixin_30924239的博客 175

【电容/电感】电路板会“滋滋”的响,我们称它为啸叫

一、啸叫的起源 大部分硬件工程师应该都遇到过,PCBA上电后出现“滋滋滋”的叫声,其声响或大或小,或时有时无,或深沉或刺耳,或变化无常者皆有。该现象我们称为“啸叫”,一般分为电感啸叫和电容啸叫。

云轩阁 6万+

示波器核心参数选型指南:带宽、采样率与嵌入式调试实战

示波器是电子工程师进行信号观测与故障诊断的基础仪器,其性能由带宽、采样率、通道数、存储深度、触发系统和探头特性共同决定。带宽定义高频响应边界,需遵循5倍法则以保障数字信号上升沿测量精度;采样率则依据奈奎斯特定理并结合工程冗余(通常≥2.5×带宽)实现可靠时域重建。二者协同影响信号完整性评估能力,尤其在UART、I²C、SPI等嵌入式总线调试中至关重要。高存储深度支持长时捕获与毛刺定位,智能触发与硬件协议解码进一步将波形分析升维至语义级。本文围绕真实嵌入式场景,解析参数间的耦合关系与典型误用陷阱。

weixin_42588877的博客 97

Delphi 10.4 社区版的 WebBrowser 在安卓下的问题

之前我写过一篇文章:Delphi APP 里面使用 HTML5 来做帮助文档,移植WebBroker进Android APP 在这篇文章里面,我提到把 HTML 的内容放进 SQLite 数据库,打包进 APP,然后使用 WebBrowser 通过内置的 Indy HTTP Server 访问数据库来显示 APP 发布给用户的帮助文档或者其它任意文档。 后来,为了不要在 APP 内部内置一个 Web Server,我试着程序启动后,将打包在 SQLite 数据库里面的 HTML, CSS, 以及页面中用

pcplayer的博客 1064

Open3d Qt的环境配置

目前统一使用qt6配置,open3d中可视化功能目前使用vtk代替,语言为c++。

阁楼 923

delphi TWebBrowser组件使用详解

delphi TWebBrowser组件使用详解      该组件是一个浏览器组件,可以显示一个指定地址的网页、设置网页打开时的主页以及对网页进行相关的操作,同时也可以对HTML文件进行剪切、复制、粘贴、删除等操作。该       组件在Internet组件页中。      1.属性      (1)AddressBar属性      设置是否显示地址栏,在TWebBrowser中没有用。  

diligentcat的专栏 2167

Unreal5从入门到精通之初学者碰到解决不了的问题怎么办?

在学习Unreal的过程中,你曾陷入困境了吗?对于我来说,这种情况发生得比我愿意承认的要多得多。幸运的是,除了一般地在网上搜索之外,还有很多地方可以获得虚幻引擎的帮助。

TxNet 991

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

delphi中document怎么把html字符串读入,如何在Delphi中将事件附加到IHTMLDocument2链接元素?...

procedure DoDocumentComplete(const pDisp: IDispatch; var URL: OleVariant);varDocument:IHTMLDocument2;Body:IHTMLElement;Links:IHTMLElementCollection;i:integer;tmp:IHTMLElement;begintryDocument := (pDis...

weixin_36211941的博客 351

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 在PB中自动注册Adaptive Server Anywhere 8.0 ODBC数据源
下一篇: 直接将html字符串读入webbrower中
Everest
博客等级 码龄26年 21粉丝 29原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值