C#如何在webbrowser中更改图像? [英] C# how do I change an image in webbrowser?
本文介绍了C#如何在webbrowser中更改图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如:
网站:
https://www.google.com/ intl / tr / gmail / about /#
如何放置我想要的图像代替Gmail的徽标?
For example:
Site:
https://www.google.com/intl/tr/gmail/about/#
How do I place the image I want in place of Gmail's logo?
<pre><a class="gmail-nav__home-link" href="/intl/tr/gmail/about/"><div class="gmail-nav__logo gmail-logo" ng-click="navCtrl.trackNavClick('Navigation', 'home')">Gmail</div></a>
我想更改那里的href
我尝试过:
I want to change the href there
What I have tried:
HtmlElement logo = webBrowser1.Document.CreateElement("img");
logo.SetAttribute("src", @"https://static1.squarespace.com/static/51c308b6e4b034c963afd820/5818f92ccd0f68da282b22b4/581a126ef7e0abdf0498c745/1478103663087/eileen-gouge-970-static.jpg");
webBrowser1.Document.Body.AppendChild(logo);
logo.SetAttribute("float", "center");
推荐答案
这不是你的网站 - 所以你不能!你不应该!
It is not your site - so you can not! And you should not!
这篇关于C#如何在webbrowser中更改图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文