資源簡介
C#記事本(實現了向上,向下查找,替換和全部替換,保存,另存為等功能)。基本模擬了windows的記事本功能。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?NotePad
{
????public?partial?class?CustCheck?:?Form
????{
????????int?p;
????????public?CustCheck()
????????{
????????????InitializeComponent();
????????}
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????this.Close();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????Form1?fm?=?(Form1)this.Owner;
????????????string?text;
????????????string?findtext;
????????????if?(checkBox1.Checked)
????????????{
????????????????findtext?=?textBox1.Text;
????????????????text?=?fm.richTextBox1.Text;
????????????}
????????????else
????????????{
????????????????findtext?=?textBox1.Text.ToLower();
????????????????text?=?fm.richTextBox1.Text.ToLower();
????????????}?if?(radioButton1.Checked)
????????????{
????????????????int?index?=?fm.richTextBox1.Find(findtext?0?fm.richTextBox1.Selectionstart?RichTextBoxFinds.Reverse);
????????????????if?(index?>?-1)
????????????????{
????????????????????fm.richTextBox1.Selectionstart?=?index;
????????????????????fm.richTextBox1.SelectionLength?=?findtext.Length;
????????????????????fm.richTextBox1.Focus();
????????????????}
????????????????else
????????????????{
????????????????????MessageBox.Show(“已到文章開頭,沒有找到匹配項“?“記事本“?MessageBoxButtons.OKCancel?MessageBoxIcon.Exclamation);
????????????????}
????????????}?if?(radioButton2.Checked)
????????????{
????????????????p?=?text.IndexOf(findtext?p);
????????????????if?(p?>=?0)
????????????????{
????????????????????fm.richTextBox1.Select(p?findtext.Length);
????????????????????fm.richTextBox1.Focus();
????????????????????p?=?p?+?findtext.Length;
????????????????}
????????????????else
????????????????{
????????????????????MessageBox.Show(“已到文章末尾,沒有找到匹配項“?“記事本“?MessageBoxButtons.OKCancel?MessageBoxIcon.Exclamation);
????????????????????p?=?0;
????????????????}
????????????}
????????????
??????????
????????}
???????
????????private?void?CustCheck_Load(object?sender?EventArgs?e)
????????{
????????????if?(textBox1.Text?==?string.Empty)
????????????{
????????????????button1.Enabled?=?false;
????????????}
????????????else?{
????????????????button1.Enabled?=?true;
????????????}
????????}
????????private?void?textBox1_TextChanged(object?sender?EventArgs?e)
????????{
????????????if?(textBox1.Text?!=?string.Empty)
????????????{
????????????????button1.Enabled?=?true?;
????????????}
????????????else
????????????{
????????????????button1.Enabled?=?false;
????????????}
????????}
????????????
????????}
????}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-03-07?16:12??NotePad\
?????目錄???????????0??2017-03-07?16:12??NotePad\NotePad\
?????文件????????6760??2017-03-06?15:26??NotePad\NotePad\Check.Designer.cs
?????文件????????2859??2017-03-06?15:26??NotePad\NotePad\Check.cs
?????文件????????5814??2017-03-06?15:26??NotePad\NotePad\Check.resx
?????文件????????4873??2017-03-06?15:49??NotePad\NotePad\CustDialog.Designer.cs
?????文件?????????482??2017-03-06?15:49??NotePad\NotePad\CustDialog.cs
?????文件???????43035??2017-03-06?15:49??NotePad\NotePad\CustDialog.resx
?????文件???????38321??2017-02-28?16:56??NotePad\NotePad\Form1.Designer.cs
?????文件???????10285??2017-03-06?15:29??NotePad\NotePad\Form1.cs
?????文件????????7217??2017-02-28?16:56??NotePad\NotePad\Form1.resx
?????文件????????4779??2017-02-28?16:56??NotePad\NotePad\NotePad.csproj
?????文件?????????488??2017-02-27?14:36??NotePad\NotePad\Program.cs
?????目錄???????????0??2017-03-07?16:12??NotePad\NotePad\Properties\
?????文件????????1370??2017-02-27?14:36??NotePad\NotePad\Properties\AssemblyInfo.cs
?????文件????????3085??2017-02-28?14:45??NotePad\NotePad\Properties\Resources.Designer.cs
?????文件????????6196??2017-02-28?14:45??NotePad\NotePad\Properties\Resources.resx
?????文件????????1092??2017-02-27?14:36??NotePad\NotePad\Properties\Settings.Designer.cs
?????文件?????????249??2017-02-27?14:36??NotePad\NotePad\Properties\Settings.settings
?????目錄???????????0??2017-03-07?16:12??NotePad\NotePad\Resources\
?????文件????????7325??2017-02-28?14:45??NotePad\NotePad\Resources\timg.jpeg
?????文件????????6691??2017-03-06?15:42??NotePad\NotePad\TiHuan.Designer.cs
?????文件????????3293??2017-03-06?15:45??NotePad\NotePad\TiHuan.cs
?????文件????????5814??2017-03-06?15:42??NotePad\NotePad\TiHuan.resx
?????目錄???????????0??2017-03-07?16:12??NotePad\NotePad\bin\
?????目錄???????????0??2017-03-07?16:12??NotePad\NotePad\bin\Debug\
?????文件???????66048??2017-03-06?15:45??NotePad\NotePad\bin\Debug\NotePad.exe
?????文件???????65024??2017-03-06?15:45??NotePad\NotePad\bin\Debug\NotePad.pdb
?????文件???????14328??2017-03-06?15:48??NotePad\NotePad\bin\Debug\NotePad.vshost.exe
?????文件?????????490??2007-07-21?01:33??NotePad\NotePad\bin\Debug\NotePad.vshost.exe.manifest
?????目錄???????????0??2017-03-07?16:12??NotePad\NotePad\obj\
............此處省略15個文件信息
- 上一篇:C#連接mysql數據庫與簡單操作
- 下一篇:ASPNETCoreAngular7
評論
共有 條評論