• 大小: 51KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-13
  • 语言: C#
  • 标签:

资源简介

麻雀虽小,五脏俱全呀。不无裨益!!!

资源截图

代码片段和文件信息

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

namespace 写字板
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string FileName;
        bool ModifiedFlag;
        bool IsSavedFlag;
        bool ExistFlag;
        string m_strOriginText;

        private void Form1_Load(object sender EventArgs e)
        {
            ModifiedFlag = true;
            IsSavedFlag = false;
            FileName = “无标题“;
            this.Text = “小小写字板“ + FileName;
            toolStripStatusLabel1.Text = “就绪“;

        }

        private void 打开ToolStripMenuItem_Click(object sender EventArgs e)
        {
            System.Windows.Forms.DialogResult yzResult;
            string yzmsg;
            string m_strFileName = ““;
            toolStripStatusLabel1.Text = “正在打开文件“;
            if (richTextBox1.Text != ““)
            {
                if (ModifiedFlag == true)
                {
                    yzmsg = “文件“ + FileName + “是否保存该文件?\n“;
                    yzResult = MessageBox.Show(thisyzmsg“小小写字板“System.Windows.Forms.MessageBoxButtons.YesNoCancelSystem.Windows.Forms.MessageBoxIcon.ExclamationSystem.Windows.Forms.MessageBoxDefaultButton.Button1);
                    if (yzResult == DialogResult.Yes)
                    {
                        if (IsSavedFlag == true)
                            menuSaveFile.PerformClick();
                        else
                            menuSaveAs.PerformClick();

                                               }
                                               if (yzResult == DialogResult.Cancel)
                                                   return;
                }
            }
            openFileDialog1.Filter = “文本文件(*.txt)|*.txt“;
            openFileDialog1.FileName = ““;
            if (openFileDialog1.ShowDialog() == DialogResult.OK || openFileDialog1.FileName.Length >= 0)
            {
                m_strFileName = openFileDialog1.FileName;
                FileName = m_strFileName;
            }
            else
                return;
            richTextBox1.Text = ““;
            FileStream m_FileStream = null;
            string m_strFileContents = ““; m_strOriginText = ““;
            if (m_strFileName != ““)
            {
                try
                {
                    int m_GetByte = 1;
                    m_FileStream = new FileStream(m_strFileName FileMode.Open FileAccess.Read);
                    byte[] m_Byte = new byte[1024];
                    m_Byte.Initialize();
                    for (; m_GetByte != 0; )
                    {
                        System.Text.Encoding encoding = System.Text.Encoding.UTF8;
                        m_Byte.Initialize();
                 

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

     文件      32768  2007-07-01 09:47  写字板\写字板\bin\Debug\写字板.exe

     文件      34304  2007-07-01 09:47  写字板\写字板\bin\Debug\写字板.pdb

     文件       5632  2005-11-11 22:25  写字板\写字板\bin\Debug\写字板.vshost.exe

     目录          0  2007-06-29 10:39  写字板\写字板\bin\Debug

     目录          0  2007-06-29 10:14  写字板\写字板\bin

     文件      11291  2007-07-01 09:47  写字板\写字板\Form1.cs

     文件      17735  2007-07-01 09:44  写字板\写字板\Form1.Designer.cs

     文件      10644  2007-07-01 09:44  写字板\写字板\Form1.resx

     目录          0  2007-06-29 11:38  写字板\写字板\obj\Debug\Refactor

     目录          0  2007-06-29 10:14  写字板\写字板\obj\Debug\TempPE

     文件        842  2007-07-01 09:47  写字板\写字板\obj\Debug\写字板.csproj.GenerateResource.Cache

     文件      32768  2007-07-01 09:47  写字板\写字板\obj\Debug\写字板.exe

     文件       2691  2007-07-01 09:47  写字板\写字板\obj\Debug\写字板.Form1.resources

     文件      34304  2007-07-01 09:47  写字板\写字板\obj\Debug\写字板.pdb

     文件        180  2007-06-29 10:39  写字板\写字板\obj\Debug\写字板.Properties.Resources.resources

     目录          0  2007-07-01 09:47  写字板\写字板\obj\Debug

     文件        282  2007-07-01 09:50  写字板\写字板\obj\写字板.csproj.FileList.txt

     目录          0  2007-06-29 10:39  写字板\写字板\obj

     文件        468  2007-06-29 10:14  写字板\写字板\Program.cs

     文件       1174  2007-06-29 10:14  写字板\写字板\Properties\AssemblyInfo.cs

     文件       2872  2007-06-29 10:14  写字板\写字板\Properties\Resources.Designer.cs

     文件       5612  2007-06-29 10:14  写字板\写字板\Properties\Resources.resx

     文件       1092  2007-06-29 10:14  写字板\写字板\Properties\Settings.Designer.cs

     文件        249  2007-06-29 10:14  写字板\写字板\Properties\Settings.settings

     目录          0  2007-06-29 10:14  写字板\写字板\Properties

     文件       3225  2007-06-29 10:16  写字板\写字板\写字板.csproj

     目录          0  2007-07-01 09:47  写字板\写字板

     文件        916  2007-06-29 10:14  写字板\写字板.sln

    ..A..H.     15360  2007-07-01 09:47  写字板\写字板.suo

     目录          0  2007-06-29 10:14  写字板

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

评论

共有 条评论

相关资源