资源简介
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个文件信息
相关资源
- c#聊天室作业及实验报告
- 摄像机漫游C#脚本WASD或方向键控制,
- [源代码] C# WinForms 经典小游戏 - 华容
- C# ASP.NET - 将Web网页导出至Word文档
- C# ASP.NET- 在线投票系统 简单
- C# - 简易聊天室实现网页
- blowfish算法的C#实现
- c# 多线程轮询,等待,回调操作
- C#连接数据库表格显示
- SignIn.zip
- 百度开源webuploader文件上传组件ASP.N
- C# mapx 开发GIS
- FileSendProtocol_20170920.rar
- 基于C#的onvif协议之抓图
- c#高级编程 第十版 中文完整版
- C# 动态生成柏拉图
- C#实现动态的曲线图
- 控制台c#下查询修改插入学生信息
- 用C#开发的一个电子时钟
- C#、Asp.Net在线翻译源码
- c# 代码编辑控件(代码着色控件)
- WPF-省市县3级联动(C#数据自动绑定,
- C# 三层架构设计模型
- WPF自定义文本下拉框模仿百度搜索
- c#winform开发运动控制卡
- C#开发交互式CAD系统
- CS开发框架 最新Ribbin版C#源码 界面美
- 自定义时间轴,Custom Slider,WPF编程
- 用c#实现画图功能可以画出各种图形,
- C# socket通信实例226433
评论
共有 条评论