• 大小: 164KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-04
  • 语言: 其他
  • 标签: ComToKey  中文解码  

资源简介

支持ANSI、Unicode、UTF-8等各种中文字符集的数据解析,并能够将数据转发到当前活动窗口的编辑框中。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace WindowsFormsApplication1
{
    public enum Enum16进制隔离符
    {
        无
        空格
        OX
        Ox
    }
    
    /// 
    /// 关于计算进制类
    /// 

    class Algorithm
    {
        //十进制转十六进制
        public string DtoX(int d)
        {
          string x=““;
          if(d<16)
          {
            x =chang(d);
          }
          else
          {
            int c;
         
            int s=0;
            int n=d;
            int temp=d;
            while(n>=16)
            {
              s++;
              n=n/16;
            }
            string[]m=new string[s];
            int i=0;
            do
            {
              c=d/16;
              m[i++]=chang(d%16);//判断是否大于10,如果大于10,则转换为A~F的格式
              d=c;
            }while(c>=16);
            x=chang(d);
            for(int j=m.Length-1;j>=0;j--)
            {
              x+=m[j];
            }
          }
          return x;
        }
        //判断是否为10~15之间的数,如果是则进行转换
        public string chang(int d)
        {
          string x = ““;
          switch(d)
          {
            case 10:
              x =“A“;
              break;
            case 11:
              x =“B“;
              break;
            case 12:
              x =“C“;
              break;
            case 13:
              x =“D“;
              break;
            case 14:
              x =“E“;
              break;
            case 15:
              x =“F“;
              break;

            default:
                    x=d.ToString();
              break;
              
          }

          return x;
        }



        #region 其他函数
        /// 
        /// 把Enum16进制隔离符转换成实际的字符串
        /// 

        /// Enum16进制隔离符
        /// 
        private static string AddGeLi(Enum16进制隔离符 enum16)
        {
            switch (enum16)
            {
                case Enum16进制隔离符.无:
                    return ““;
                case Enum16进制隔离符.Ox:
                    return “0x“;
                case Enum16进制隔离符.OX:
                    return “0X“;
                case Enum16进制隔离符.空格:
                    return “ “;
                default:
                    return ““;
            }
        }
        /// 
        /// 去掉16进制字符串中的隔离符
        /// 

        /// 需要转换的字符串
        /// 
        private static string DelGeLi(string inString)
        {
            string outString = ““;
            string[] del = { “ “ “0x“ “0X“ };
            if (inString.Contains(“ “) || inString.Contains(“0x“) || inString.Contains(“0X“))//存在隔离符
            {
                string[] strS = inString.Split(del System.StringSplitOptions.Rem

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-01-06 11:33  ComToKey\
     目录           0  2017-01-04 16:24  ComToKey\.vs\
     目录           0  2017-01-04 16:24  ComToKey\.vs\WindowsFormsApplication1\
     目录           0  2017-01-04 16:24  ComToKey\.vs\WindowsFormsApplication1\v14\
     文件       77312  2017-08-01 12:11  ComToKey\.vs\WindowsFormsApplication1\v14\.suo
     文件         766  2011-05-24 22:27  ComToKey\ComTone.ico
     目录           0  2017-01-07 18:46  ComToKey\WindowsFormsApplication1\
     文件        1039  2017-01-04 16:25  ComToKey\WindowsFormsApplication1.sln
     文件       25088  2011-07-20 11:02  ComToKey\WindowsFormsApplication1.suo
     文件       10024  2017-01-07 18:39  ComToKey\WindowsFormsApplication1\Algorithm.cs
     目录           0  2017-01-06 11:34  ComToKey\WindowsFormsApplication1\bin\
     目录           0  2017-02-09 10:24  ComToKey\WindowsFormsApplication1\bin\Debug\
     文件       29696  2017-01-07 18:46  ComToKey\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
     文件       46592  2017-01-07 18:46  ComToKey\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
     文件       21680  2017-01-07 16:01  ComToKey\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
     文件         490  2010-03-18 13:39  ComToKey\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
     目录           0  2017-01-07 18:55  ComToKey\WindowsFormsApplication1\bin\Release\
     文件       28160  2017-01-07 18:55  ComToKey\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe
     文件       42496  2017-01-07 18:55  ComToKey\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.pdb
     文件       21680  2017-08-01 12:10  ComToKey\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.vshost.exe
     文件         490  2010-03-18 13:39  ComToKey\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.vshost.exe.manifest
     文件       22655  2017-01-07 18:46  ComToKey\WindowsFormsApplication1\Form1.cs
     文件       30086  2017-01-07 17:45  ComToKey\WindowsFormsApplication1\Form1.Designer.cs
     文件        8024  2017-01-07 16:09  ComToKey\WindowsFormsApplication1\Form1.resx
     目录           0  2011-07-18 14:56  ComToKey\WindowsFormsApplication1\obj\
     目录           0  2017-01-07 18:46  ComToKey\WindowsFormsApplication1\obj\Debug\
     文件        1372  2017-01-06 11:36  ComToKey\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7003  2017-01-06 17:24  ComToKey\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2011-05-24 15:42  ComToKey\WindowsFormsApplication1\obj\Debug\Refactor\
     目录           0  2017-01-04 16:25  ComToKey\WindowsFormsApplication1\obj\Debug\TempPE\
     文件        3584  2017-01-04 16:33  ComToKey\WindowsFormsApplication1\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
............此处省略26个文件信息

评论

共有 条评论

相关资源