Custom work flow

时间:2022-09-25 17:09:22

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 自定义布局&lpar;custom flow layout&rpar;

    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&period;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&comma;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. ASP&period;NET MVC最新特性

    问题: 既然我说对ASP.NET MVC很熟很懂,对新技术很感兴趣,那么问题是: 当前最新版MVC是什么?你用的哪个版本?相比前一个版本有什么新的特性? 解析: 在面试的时候,为了争取面试官的好感,显 ...

  2. label按钮和文字对齐

    label按钮和文字对齐 做表单的时候,经常遇到:复选框和文字对不齐的情况 ========================== 下面方法可以对齐 <!--label [[--> < ...

  3. &lbrack;UWP&rsqb;使用Acrylic

    1. 前言 在 如何使用Fluent Design System 这篇文章里已经简单介绍过Reveal的用法,这篇再详细介绍其它内容. 自Windows 8 放弃Aero后,群众对毛玻璃回归的呼声一致 ...

  4. 你不知道的JS之作用域和闭包(三)函数 vs&period; 块级作用域

      原文:你不知道的js系列 在第(二)节中提到的,标识符在作用域中声明,这些作用域就像是一个容器,一个嵌套一个,这个嵌套关系是在代码编写时定义的. 那么到底是什么产生了一个新的作用域,只有函数能做到 ...

  5. 天虎云商wap和微信话项目总结

    1:架构:以后要采用项目分模块的方式写代码了,不能写一个公用的controller包,每个模块分包,分别建立service,dao,但是模块同级的有个功能的baseDao,        BaseSe ...

  6. 深度学习中交叉熵和KL散度和最大似然估计之间的关系

    机器学习的面试题中经常会被问到交叉熵(cross entropy)和最大似然估计(MLE)或者KL散度有什么关系,查了一些资料发现优化这3个东西其实是等价的. 熵和交叉熵 提到交叉熵就需要了解下信息论 ...

  7. sqlalchemy的fliter使用总结

    1.sqlalchemy查询操作的filter函数内,日期比较用datetime试了半天行不通(因为数据库表中那个字段是datetime类型,最后是用字符串"%Y-%m-%d %H:%M:% ...

  8. CAS单点登录的时候出现票根&&num;39&semi;ST-xxxxxx-cas&&num;39&semi;不符合目标服务

    CAS单点登录遇到问题:票根'ST-xxxxxx-cas'不符合目标服务,原因出在linux 时间未同步,差了3分钟 .

  9. Python 面向对象编程的一些特征 及 单例模式的实现&comma; 父类方法的调用&lpar;python2&sol;python3&rpar;

    一.面向对象编程几个特征(封装, 继承,多态) 1.封装:类里面封装函数和变量, 在将类进行实例化成实例对象时进行传参, 从而生成不同的实例对象,增加代码的复用. 2.继承:子类可以继承父类的方法和属 ...

  10. 实现一个自定义event事件,包括on &comma;off&comma;trigger&comma;once

    on监听事件,off取消事件 ,trigger触发事件,once只执行一次 class Event { constructor() { this.handlers = {};//记录所有的事件以及处理 ...