基本信息
源码名称:桌面UI皮肤示例源码(IrisSkin)
源码大小:1.54M
文件格式:.zip
开发语言:C#
更新时间:2020-12-07
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

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<string> tb1 = new List<string>();
            List<string> tb2 = new List<string>();
            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()   "%";
        }
    }
}