我正在我的当前项目中使用一个Web浏览器,并且目前我正在使用它的设计模式使其可编辑等。 我目前正在使用的代码是:
WebBrowser.Document.DomDocument as IHTMLDocument2
什么是IHTMLDocument2、3或4?我还发现,在确定文档中的当前选择范围时,range.text.replace方法不能像字符串替换一样工作。
可以有人解释一下IHTMLDocuments和IHTMLTxtRange的基本功能吗?
我正在我的当前项目中使用一个Web浏览器,并且目前我正在使用它的设计模式使其可编辑等。 我目前正在使用的代码是:
WebBrowser.Document.DomDocument as IHTMLDocument2
什么是IHTMLDocument2、3或4?我还发现,在确定文档中的当前选择范围时,range.text.replace方法不能像字符串替换一样工作。
可以有人解释一下IHTMLDocuments和IHTMLTxtRange的基本功能吗?
public interface IMyInterface {
public int Property1 { get; set; }
}
public interface IMyInterface2 {
public int Property2 { get;set; }
}
public class MyObject : IMyInterface, IMyInterface2 {
public int Property1 { get {} set {} }
public int Property2 { get {} set {} }
}
if (obj is IMyInterface) {
Console.WriteLine(((IMyInterface)obj).Property1);
if (obj is IMyInterface2) {
//more
}
}