http://runjs.cn/detail/99epj1t2

http://www.cqroad.cn/

https://jsplumbtoolkit.com/demo/flowchart/dom.html

正则表达式的用法

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.IO;

namespace ConvertHtml
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void buttonConvert_Click(object sender, EventArgs e)
        {
            ConvertFiles(richTextBoxFrom.Text);
        }

        private void ConvertFiles(string path)
        {
            string[] aspxFiles = Directory.GetFiles(path, "*.aspx", SearchOption.AllDirectories);
            foreach (string filePath in aspxFiles)
            {
                string fileContent = File.ReadAllText(filePath);
                if (!string.IsNullOrEmpty(fileContent))
                {
                    fileContent = AddMasterPageIntoPage(fileContent);
                    File.WriteAllText(filePath, fileContent);
                }
            }
        }

        private string ReplaceIngoreCase(string source, string oldValue, string newValue)
        {
            var regex = new Regex(oldValue, RegexOptions.IgnoreCase);
            return regex.Replace(source, newValue);
        }

        private string AddMasterPageIntoPage(string strHtmlFrom) {
            )
                return strHtmlFrom;
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "<body.*>", "<asp:Content ID=\"bodyContent\" ContentPlaceHolderID=\"mainContent\" runat=\"server\">");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "</body>", "</asp:Content>");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "</html>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "<head>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "</head>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "<!DOCTYPE HTML.*>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "<html>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "<meta.*>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, @"<title>.*</title>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, @"<link (.*)css.css(.*)>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, @"<link (.*)style2.css(.*)>", "");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "<script language=\"javascript\">", "<asp:Content ID=\"scriptContent\" ContentPlaceHolderID=\"headContent\" runat=\"server\"><script language=\"javascript\">");
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "</script>", "</script></asp:Content>");

            strHtmlFrom = Regex.Replace(strHtmlFrom, "<font face='宋体'>(?<content>.*)</font>", "${content}", RegexOptions.IgnoreCase);
            strHtmlFrom = Regex.Replace(strHtmlFrom, "<font face=\"宋体\">(?<content>.*)</font>", "${content}", RegexOptions.IgnoreCase);
            strHtmlFrom = ReplaceIngoreCase(strHtmlFrom, "<font face='宋体'>|<font face=\"宋体\">", "");

            return strHtmlFrom;
        }
    }
}

Custom work flow的更多相关文章

  1. Collection View 自定义布局(custom flow layout)

    Collection view自定义布局 一般我们自定义布局都会新建一个类,继承自UICollectionViewFlowLayout,然后重写几个方法: prepareLayout():当准备开始布 ...

  2. Spring Enable annotation – writing a custom Enable annotation

    原文地址:https://www.javacodegeeks.com/2015/04/spring-enable-annotation-writing-a-custom-enable-annotati ...

  3. Advanced Collection Views and Building Custom Layouts

    Advanced Collection Views and Building Custom Layouts UICollectionView的结构回顾 首先回顾一下Collection View的构成 ...

  4. 用 flow.ci 让 Hexo 持续部署

    编者按:感谢 @小小小杜 投稿,原文链接Juglans' Blog.如果你也想体验 flow.ci 的自动化持续部署,来 http://flow.ci 首页提交申请,邀请码随后会发送到邮箱:) flo ...

  5. Upgrade custom workflow in SharePoint

    Experience comes when you give a try or do something, I worked in to many SharePoint development pro ...

  6. The finnacial statements,taxes and cash flow

    This chapter-2 we learn about the the financial statements(财务报表),taxes and cash flow.We must pay par ...

  7. Custom draw 和 Owner draw 的区别

    "Custom Draw" is a feature shared by all of Microsoft's common controls, which allows you ...

  8. Oracle Applications Multiple Organizations Access Control for Custom Code

    档 ID 420787.1 White Paper Oracle Applications Multiple Organizations Access Control for Custom Code ...

  9. Writing custom protocol for nanomsg

    http://vitiy.info/writing-custom-protocol-for-nanomsg/ nanomsg is next version of ZeroMQ lib, provid ...

随机推荐

  1. java面试问题整理-垃圾回收

    对于GC来说,当程序员创建对象时,GC就开始监控这个对象的地址.大小以及使用情况.通常,GC采用有向图的方式记录和管理堆(heap)中的所有对象,通过这种方式确定哪些对象是"可达的" ...

  2. mysql 主主互备

    双机热备的概念简单说一下,就是要保持两个数据库的状态自动同步.对任何一个数据库的操作都自动应用到另外一个数据库,始终保持两个数据库数据一致. 这样做的好处多. 1. 可以做灾备,其中一个坏了可以切换到 ...

  3. iOS开发之XCode模拟器不能连接网络

    新装的Xcode7 编译程序 出现 #warning: 获取app配置信息失败: The resource could not be loaded because the App Transport ...

  4. div span

    无牵无挂,不带任何样式,因此经常使用div完成整体样式的构建,span完成细微样式的构建. div为块级元素,span为行内元素. 使用div完成显示区域的居中.左右浮动等,完成整体的样式布局,然后在 ...

  5. 阿里云服务器Linux CentOS安装配置(三)yum安装mysql

    阿里云服务器Linux CentOS安装配置(三)yum安装mysql 1.执行yum安装mysql命令:yum -y install mysql-server mysql-devel 2.启动mys ...

  6. hibernate学习(8)——事务.连接池.锁 相关设置

    1.整合c3p0(连接池) 步骤一:导入c3p0 jar包 步骤二:hibernate.cfg.xml 配置 hibernate.connection.provider_class org.hiber ...

  7. 【转】NGUI研究院之三种方式监听NGUI的事件方法(七)

    NGUI事件的种类很多,比如点击.双击.拖动.滑动等等,他们处理事件的原理几乎万全一样,本文只用按钮来举例. 1.直接监听事件 把下面脚本直接绑定在按钮上,当按钮点击时就可以监听到,这种方法不太好很不 ...

  8. 1.Maven的安装以及本地仓库的配置

    安装: maven下载地址:http://maven.apache.org/release-notes-all.html 然后解压,配置环境变量   MAVEN_HOME,并添加到path中.验证是否 ...

  9. 在Ubuntu上安装网易云音乐

    对于网易,我只服云音乐,业界良心,用过的人都知道.我最喜欢的就是歌曲的评论功能,还有朋友圈子.里面有很多好段子,还有很多的好故事,基本上,不是分手,就是回忆初恋,还有吐槽的.我认为音乐带给人的不仅是耳 ...

  10. ORM系列之二:EF(2)Code First

    目录 1. Code First是什么? 2. Code First 简单示例 3. 数据存储 4. 迁移 Code First是什么 Code First 顾名思义就是先写代码,当然不是乱写,而是按 ...