• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    .net中mshtml处理html的方法

    1.添加引用.net 引用Microsoft.mshtml

    WebClient wc = new WebClient();
    wc.Encoding = Encoding.UTF8;
    string str = wc.DownloadString(@"https://www.jb51.net/web/73969.html");

    HTMLDocumentClass doc = new HTMLDocumentClass();//获取html对象
    doc.designMode = "on"; //不让解析引擎去尝试运行javascript
    doc.IHTMLDocument2_write(str);把html 文档写入html对象中
    doc.close();关闭写流
    Console.WriteLine(doc.title);输出标题
    Console.WriteLine(doc.body.innerText); 输出body
    Console.ReadKey();

    上一篇:AJAX JavaScript反射机制的介绍
    下一篇:.NET UEditor使用方法说明
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯

    时间:9:00-21:00 (节假日不休)

    地址:江苏信息产业基地11号楼四层

    《增值电信业务经营许可证》 苏B2-20120278

    .net中mshtml处理html的方法 .net,中,mshtml,处理,html,的,