C#Live HTML编辑器... [英] C# Live HTML editor...

查看:268
本文介绍了C#Live HTML编辑器...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何做到这一点,以便可以在浏览器中加载wbsite,并且该网站的html代码将出现在richtextbox中,并且我可以编辑该html,并且随着我更改richtextbox中的文本,网页也会更改? div class ="h2_lin">解决方案

那不是那么简单:如果使用WebBrowser控件并将DocumentText属性设置为字符串,则使用基本文本是可能的-存在问题但是,如果您使用任何相对路径(包括那些以〜"开头的路径).
唯一的另一种方法是每次RTB更改时都保存文件,并告诉浏览器刷新:最简单的方法是将F5键发送给浏览器-这里有一篇文章可能会有所帮助: ://www.codeproject.com/KB/cs/SendKeys.aspx>将击键发送到C#中的另一个应用程序 [ 解决方案

It is not quite as simple as that: with basic text it is possible, if you use a WebBrowser control and set the DocumentText property to the string - there are problems though if you use any relative paths (including those starting "~").
The only other way is to save the file each time the RTB changes, and tell the browser to refresh: the easiest way is to send the F5 key to the browser - there is an article here which may help:
Sending Keystrokes to another Application in C#[^]


这篇关于C#Live HTML编辑器...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发语言最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆