• 大小: 176KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: C#
  • 标签: C#  文本  编辑器  代码  

资源简介

c#的文本编译器代码,用vs2013编译完成

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
using System.IO;



namespace TextReader
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        Form2 f2 = new Form2();
        private void menuFileNew_Click(object sender EventArgs e)
        {
            Form2 f2 = new Form2();
            f2.MdiParent = this;
            f2.Show();
        }

        private void menuFileOpen_Click(object sender EventArgs e)
        {

            this.openFileDialog.InitialDirectory = @“D:\“;
            this.openFileDialog.title = “打开文本文件“;
            this.openFileDialog.Multiselect = false;
            this.openFileDialog.Filter = “文本文件(*.txt)|*.txt“ + “|所有文件(*.*)|*.*“;
            DialogResult get = this.openFileDialog.ShowDialog();
            if (get == DialogResult.Cancel)
            {
                return;
            }
            if (get == DialogResult.OK)
            {
                Form2 son;
                if (this.MdiChildren.Length == 0)
                {
                    son = new Form2();
                    son.richTextBox1.LoadFile(openFileDialog.FileName RichTextBoxStreamType.PlainText);
                }
                else
                {
                    son = (Form2)this.ActiveMdiChild;
                    son.richTextBox1.LoadFile(openFileDialog.FileName RichTextBoxStreamType.PlainText);
                }
                son.Text = this.openFileDialog.FileName;
                son.MdiParent = this;
                son.Show();
            }
        }

        private void menuFileSave_Click(object sender EventArgs e)
        {
            if (this.MdiChildren.Length == 0)
            {
                return;
            }
            saveFileDialog.Filter = “文本文件(*.txt)|*.txt“ + “|所有文件|*.*“;
            saveFileDialog.InitialDirectory = @“d:\“;
            DialogResult result = saveFileDialog.ShowDialog();
            if (result == DialogResult.Cancel)
            {
                return;
            }
            if (result == DialogResult.OK)
            {
                    Form2 f2 = (Form2)this.ActiveMdiChild;
                    f2.richTextBox1.SaveFile(saveFileDialog.FileName RichTextBoxStreamType.PlainText);
                    MessageBox.Show(“保存成功“);  
            }
        }
    
        private void tsbFontBackColor_Click(object sender EventArgs e)
        {
            Form2 f2 = (Form2)this.ActiveMdiChild;
            if (f2 != null)
            {
                DialogResult result = this.colorDialog1.ShowDialog();
                if (result == DialogResult.OK)
                {
                    f2.richTextBox1.SelectionBackColor = this.colorDialog1.Color;
                }
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        163  2014-05-31 20:52  text reader\app.config

     文件      42496  2014-06-01 11:38  text reader\bin\Release\Text Reader.exe

     文件        163  2014-05-31 20:52  text reader\bin\Release\Text Reader.exe.config

     文件      44544  2014-06-01 11:38  text reader\bin\Release\Text Reader.pdb

     文件      24224  2014-06-01 11:38  text reader\bin\Release\Text Reader.vshost.exe

     文件        163  2014-05-31 20:52  text reader\bin\Release\Text Reader.vshost.exe.config

     文件        490  2013-06-18 20:28  text reader\bin\Release\Text Reader.vshost.exe.manifest

     文件      22879  2014-06-01 11:41  text reader\Form1.cs

     文件      38500  2014-06-01 11:31  text reader\Form1.Designer.cs

     文件      28894  2014-06-01 11:31  text reader\Form1.resx

     文件        356  2014-05-31 19:09  text reader\Form2.cs

     文件       2242  2014-05-31 19:09  text reader\Form2.Designer.cs

     文件       5814  2014-05-31 18:48  text reader\Form2.resx

     文件        900  2009-06-18 12:53  text reader\obj\Debug\RichTextBox.csproj.GenerateResource.Cache

     文件      20504  2009-06-18 12:53  text reader\obj\Debug\RichTextBox.Form1.resources

     文件       1332  2009-06-18 10:34  text reader\obj\Debug\RichTextBox.Form2.resources

     文件        180  2009-06-15 10:45  text reader\obj\Debug\RichTextBox.Properties.Resources.resources

     文件       4608  2009-06-15 11:12  text reader\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       2085  2014-05-31 21:37  text reader\obj\Release\DesignTimeResolveAssemblyReferences.cache

     文件       6566  2014-05-31 20:52  text reader\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache

     文件        879  2014-05-31 19:02  text reader\obj\Release\RichTextBox.csproj.FileListAbsolute.txt

     文件        905  2014-05-31 18:48  text reader\obj\Release\RichTextBox.csproj.GenerateResource.Cache

     文件       1341  2014-05-31 17:55  text reader\obj\Release\RichTextBox.csprojResolveAssemblyReference.cache

     文件          0  2014-05-31 19:07  text reader\obj\Release\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2014-05-31 19:07  text reader\obj\Release\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2014-05-31 19:07  text reader\obj\Release\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       4608  2014-05-31 20:52  text reader\obj\Release\TempPE\Properties.Resources.Designer.cs.dll

     文件       1708  2014-06-01 11:38  text reader\obj\Release\Text Reader.csproj.FileListAbsolute.txt

     文件       1035  2014-06-01 11:31  text reader\obj\Release\Text Reader.csproj.GenerateResource.Cache

     文件       2843  2014-05-31 20:52  text reader\obj\Release\Text Reader.csprojResolveAssemblyReference.cache

............此处省略73个文件信息

评论

共有 条评论