• 大小: 1.54M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-02
  • 语言: C#
  • 标签: 桌面  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace 界面设计练习
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
            this.skinEngine1 = new Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
            this.skinEngine1.SkinFile = Application.StartupPath + “//Vista2_color4.ssk“;
        }

        private void Form1_Load(object sender EventArgs e)
        {

        }

        private void button1_Click(object sender EventArgs e)
        {
            String str1 = textBox1.Text;
            String str2 = textBox2.Text;
            label1.Text = get_semblance_By_2words(str1 str2);
        }
        public static string get_semblance_By_2words(string word1 string word2)
        {
            int re = 0;
            int maxLength;
            int i j;
            List tb1 = new List();
            List tb2 = new List();
            i = 0;
            j = 1;
            maxLength = word1.Length;
            if (word1.Length < word2.Length)
                maxLength = word2.Length;
            while (j <= word1.Length)
            {
                while (i < word1.Length - 1)
                {
                    if (i + j > word1.Length)
                        break;
                    tb1.Add(word1.Substring(i j));
                    i++;
                }
                i = 0;
                j++;
            }

            i = 0;
            j = 1;

            while (j <= word2.Length)
            {
                while (i < word2.Length - 1)
                {
                    if (i + j > word2.Length)
                        break;
                    tb2.Add(word2.Substring(i j));
                    i++;
                }
                i = 0;
                j++;
            }
            foreach (string subStr in tb1)
            {
                int tempRe = 0;
                if (tb2.Contains(subStr))
                {
                    tempRe = subStr.Length * 100 / maxLength;
                    if (tempRe > re)
                        re = tempRe;
                    if (tempRe == 100)
                        break;
                }
            }
            return “相似度:“+re.ToString() + “%“;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-10-15 08:47  界面设计练习\
     目录           0  2020-10-15 08:47  界面设计练习\.vs\
     目录           0  2020-10-15 08:47  界面设计练习\.vs\界面设计练习\
     目录           0  2020-10-15 08:47  界面设计练习\.vs\界面设计练习\v15\
     文件       46080  2020-10-15 15:34  界面设计练习\.vs\界面设计练习\v15\.suo
     目录           0  2020-10-15 08:47  界面设计练习\.vs\界面设计练习\v15\Server\
     目录           0  2020-10-15 08:47  界面设计练习\.vs\界面设计练习\v15\Server\sqlite3\
     文件           0  2020-10-15 08:47  界面设计练习\.vs\界面设计练习\v15\Server\sqlite3\db.lock
     文件        4096  2020-10-15 08:47  界面设计练习\.vs\界面设计练习\v15\Server\sqlite3\storage.ide
     文件       32768  2020-10-15 12:45  界面设计练习\.vs\界面设计练习\v15\Server\sqlite3\storage.ide-shm
     文件     2929352  2020-10-15 14:43  界面设计练习\.vs\界面设计练习\v15\Server\sqlite3\storage.ide-wal
     目录           0  2020-10-15 14:43  界面设计练习\界面设计练习\
     文件         189  2020-10-15 08:47  界面设计练习\界面设计练习\App.config
     文件        4774  2020-10-15 13:45  界面设计练习\界面设计练习\Form1.Designer.cs
     文件        2627  2020-10-15 14:43  界面设计练习\界面设计练习\Form1.cs
     文件        6016  2020-10-15 13:45  界面设计练习\界面设计练习\Form1.resx
     文件         530  2020-10-15 08:47  界面设计练习\界面设计练习\Program.cs
     目录           0  2020-10-15 08:47  界面设计练习\界面设计练习\Properties\
     文件        1334  2020-10-15 08:47  界面设计练习\界面设计练习\Properties\AssemblyInfo.cs
     文件        2849  2020-10-15 08:47  界面设计练习\界面设计练习\Properties\Resources.Designer.cs
     文件        5612  2020-10-15 08:47  界面设计练习\界面设计练习\Properties\Resources.resx
     文件        1105  2020-10-15 08:47  界面设计练习\界面设计练习\Properties\Settings.Designer.cs
     文件         249  2020-10-15 08:47  界面设计练习\界面设计练习\Properties\Settings.settings
     目录           0  2020-10-15 08:47  界面设计练习\界面设计练习\bin\
     目录           0  2020-10-15 10:44  界面设计练习\界面设计练习\bin\Debug\
     文件       20139  2010-04-04 21:03  界面设计练习\界面设计练习\bin\Debug\Calmness.ssk
     文件       20271  2010-04-04 21:03  界面设计练习\界面设计练习\bin\Debug\CalmnessColor1.ssk
     文件       20208  2010-04-04 21:03  界面设计练习\界面设计练习\bin\Debug\CalmnessColor2.ssk
     文件        5032  2010-04-04 21:03  界面设计练习\界面设计练习\bin\Debug\DeepCyan.ssk
     文件        5037  2010-04-04 21:03  界面设计练习\界面设计练习\bin\Debug\DeepGreen.ssk
     文件        4908  2010-04-04 21:03  界面设计练习\界面设计练习\bin\Debug\DeepOrange.ssk
............此处省略90个文件信息

评论

共有 条评论