2

我正在使用Winform 文本框来编辑 HTML 片段,并且该项目使用 Winforms WebBrowser 控件。例如,如果我的 HTMLimg标签的src属性使用相对路径src="../cat_images/VOD/VOD_logo_small_2.jpg",它将变成src="about:../cat_images/VOD/VOD_logo_small_2.jpg"

我该如何摆脱about:

我应该只写一个方法来过滤掉about:,还是 WebBrowser 控件中有一个设置可以用来禁用它?WebBrowser 控件还添加了一个额外的回车符和换行符。有没有办法禁用它?

this.htmDisplay.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.chemicalMasterBindingSource, "CatalogDesc", true));
        this.htmDisplay.Fonts = new string[] {
    "Corbel",
    "Corbel, Verdana, Arial, Helvetica, sans-serif",
    "Georgia, Times New Roman, Times, serif",
    "Consolas, Courier New, Courier, monospace"};
        this.htmDisplay.IllegalPatterns = new string[] {
    "<script.*?>",
    "<\\w+\\s+.*?(j|java|vb|ecma)script:.*?>",
    "<\\w+(\\s+|\\s+.*?\\s+)on\\w+\\s*=.+?>",
    "</?input.*?>"};
        this.htmDisplay.Location = new System.Drawing.Point(92, 126);
        this.htmDisplay.Name = "htmDisplay";
        this.htmDisplay.Padding = new System.Windows.Forms.Padding(1);
        this.htmDisplay.ShowHtmlSource = true;
        this.htmDisplay.Size = new System.Drawing.Size(516, 245);
        this.htmDisplay.TabIndex = 149;
        this.htmDisplay.ToolbarStyle = GvS.Controls.ToolbarStyles.AlwaysInternal;                   
4

0 回答 0