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. Linux下安装搭建WordPress网站

    WordPress简介 WordPress 是一种使用 PHP语言和 MySQL数据库开发的开源.免费的Blog(博客,网志)引擎,用户可以在支持 PHP 和 MySQL 数据库的服务器上建立自己的 ...

  2. PHP 字符串的隐式转换规则以及针对包含字母的字符串的递增/递减操作

    之前一直对 PHP 中关于字符串的算数运算隐式类型转换规则和递增/递减操作符针对字符串的操作比较模糊,今天总结一下. 一.隐式转换 二进制算术运算符的隐式类型转换规则(http://php.net/m ...

  3. Android 操作系统的内存回收机制(转载)

    Android 操作系统的内存回收机制(转载) Android APP 的运行环境 Android 是一款基于 Linux 内核,面向移动终端的操作系统.为适应其作为移动平台操作系统的特殊需要,谷歌对 ...

  4. utils.js

    /** * //2.0检测方式(目测,测量,专用仪器测试等) function GetCheckType() { $.ajax({ url: '@Url.Action("GetCheckTy ...

  5. Exec in Job and NewQuery

    1.背景 Job:一个步骤执行两个存储过程ProcA.ProcB.ProcA定义一个游标,从表TabA中检索数据,逐条插入到表TabB.如果某条数据不满足TabB上的约束(比如非空)导致插入失败.那么 ...

  6. php程序员绝不能违背的安全铁则

    作为PHP程序员,特别是新手,对于互联网的险恶总是知道的太少,对于外部的入侵有很多时候是素手无策的,他们根本不知道黑客是如何入侵的.提交入侵.上传漏洞.sql 注入.跨脚本攻击等等.作为最基本的防范你 ...

  7. sqlserver日志的备份与还原

    ----------完整备份与还原----------                --完整备份数据库--backup database studb to disk='e:\stu.bak'back ...

  8. Python —条件语句

    条件语句 Python条件语句是通过一条或多条语句的执行结果(True或者False)来决定执行的代码块. 可以通过下图来简单了解条件语句的执行过程: Python程序语言指定任何非0和非空(null ...

  9. react lazyload

    思路: DOM加载时,<img> 标签里,添加data-src路径 = src 路径, src路径 = 本地默认图片路径, DOM加载完成后,监听页面可视区域,有data-src时,就将s ...

  10. WebForm 内置对象

    内置对象: Response对象:响应请求 Response.Write("<script>alert('添加成功!')</script>"); Respo ...