刚下载的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("{", "\r\n {"); text = text.Replace("{", "\r\n {"); text = text.Replace("}", "} \r\n"); File.WriteAllText("test.txt", text); }