findform.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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 记事本
{
    public partial class findform : Form
    {
        public findform()
        {
            InitializeComponent();
            radioButton2.Checked = true;
        }

        private string keyword = string.Empty;
        int pos = 0;      //向下查找时关键字的位置
        string text = string.Empty;//主窗体中字符串变量
        int upos = 0;  //向上查找时关键字位置
        bool isDown = true;
        bool isCase = true; //是否区分大小写

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == string.Empty)
            {
                return;
            }
            else
            {
                keyword = textBox1.Text;
                if (isCase)  //区分大小时
                {
                    if (isDown)
                    {
                        pos = text.IndexOf(keyword, pos);
                    }
                    else
                    {
                        upos = text.IndexOf(keyword, upos);
                    }
                }

                else   //不区分大小写
                {
                    keyword = keyword.ToLower();
                    text = text.ToLower();
                    if (isDown)
                    {
                        pos = text.IndexOf(keyword, pos);
                    }
                    else
                    {
                        upos = text.IndexOf(keyword, upos);
                    }
                }
后面还有 75 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。