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. myeclipse项目上出现红色叹号

    右键选中项目:build path→configure build path (由于的我是在问题解决之后发表的博客,所以jar包上面的红色叉子不见了,只要选中红色的jar包,然后选择‘Remove’按 ...

  2. 【iCore3 双核心板_FPGA】实验二十六:SDRAM读写测试实验

    实验指导书及代码包下载: http://pan.baidu.com/s/1c1VRibY iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...

  3. Centos防火墙禁止ping和开启ping

    1.允许PING设置 iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT iptables -A OUTPUT -p icmp - ...

  4. [dpdk] 熟悉SDK与初步使用 (四)(L3 Forwarding源码分析)

    接续前节:[dpdk] 熟悉SDK与初步使用 (三)(IP Fragmentation源码分析) 前文中的最后一个问题,搁置,并没有找到答案.所以继续阅读其他例子的代码,想必定能在其他位置看到答案. ...

  5. UISprite(NGUI)扩展 图片镂空

    NGUI 版本2.6.3 在做新手引导时,需要高亮特定UI元素,也就是加个黑色蒙板,然后在蒙版上显示这个UI元素,为了简单方便我扩展了下UISprite,来镂空指定空间. 分为2种,矩形和圆镂空,矩形 ...

  6. 【Html 学习笔记】第二节——文本格式

    上一节基本已经了解了一些html的基础,这一节主要学习html处理文本相关内容,直接看内容吧. 字体: 预格式文本:<pre> 地址:<address> 缩写:<abbr ...

  7. Mongodb基本操作说明

    Mongodb基本操作说明 1.首先cmd(管理员方式运行)下启动mongo服务(类似初始化工具): Mongod.exe 默认文件夹为 :c:\data\db 如果没有创建该文件夹的话,需要先创建该 ...

  8. 图解GCD

    线程.任务和队列的概念 异步.同步 & 并行.串行的特点 一条重要的准则 一般来说,我们使用GCD的最大目的是在新的线程中同时执行多个任务,这意味着我们需要两项条件: 能开启新的线程 任务可以 ...

  9. JAVASE02-Unit010: 多线程基础 、 TCP通信

    多线程基础 . TCP通信 * 当一个方法被synchronized修饰后,那么 * 该方法称为同步方法,即:多个线程不能同时 * 进入到方法内部执行. package day10; /** * 当多 ...

  10. jvm 配置

    # 内存参数MEMORY_OPTS="-Xms2048m -Xmx2048m -Xmn1024m -XX:MaxDirectMemorySize=2048m -XX:PermSize=256 ...