zoukankan      html  css  js  c++  java
  • 把下载的CSS文件改为可读的形式

    刚下载的CSS文件不分段,难读,所以用c#程序把它换为更可读的形式,

    就是在 所有的 "{"之前     和  "}"之后   加回车和换行  

    程序如下

    using System.IO;
    
    
            private void button1_Click(object sender, EventArgs e)
            {
                //get path
                OpenFileDialog op = new OpenFileDialog();
                op.RestoreDirectory = true;
                op.Filter = "All|*.*|xlsx|*.xlsx";
                if (op.ShowDialog() != DialogResult.OK)
                    return;
    
                textBox1.Text = op.FileName;
            }
    
            private void button2_Click(object sender, EventArgs e)
            {
              
    
                    string text = File.ReadAllText(textBox1.Text);
                    //text = text.Replace("{", "
     {");
    
                    text = text.Replace("{", "
     {");
                    text = text.Replace("}", "} 
    ");
    
    
                    File.WriteAllText("test.txt", text);
    
            }

     

  • 相关阅读:
    Linux中的中断处理
    Yocto使用小技巧
    udev学习笔记汇总
    USB gadget学习笔记
    Linux常用命令
    Linux下软件安装方法
    278. First Bad Version
    MySQL的索引
    7. Reverse Integer
    排序算法
  • 原文地址:https://www.cnblogs.com/lthxk-yl/p/3645275.html
Copyright © 2011-2022 走看看