zoukankan      html  css  js  c++  java
  • C#加密

    using System;
    using System.Text;
    using System.IO;

    namespace 这是一个加密文件的程序
    {
        public class _输入你的加密口令
        {
            private string password;

            public string Password
            {
                get { return password; }
                set { password = value; }
            }

            public _输入你的加密口令(string temp)
            {
                this.password = temp;
            }
            public _输入你的加密口令()
            {
                Console.WriteLine("请输入你的口令:");
                this.Password=Console.ReadLine();  //没有写完。。不晓得杂写了,下雨了,先睡觉去了哦。
            }

        }


        public class 加密的文件
        {
            _输入你的加密口令 password = null;
            public readonly int count; public readonly char[] 密码;
           
            public 加密的文件()
            {

            }
            public 加密的文件(string temp)
            {
                if (File.Exists(@temp))
                {
                    StreamReader str = new StreamReader(@temp);
                    string mytemp = str.ReadToEnd();
                    if (mytemp.Length > 0)
                    {
                        password = new _输入你的加密口令();
                        count = password.Password.ToString().Length;
                        密码 = new char[count];
                        for (int i = 0; i < count; i++)
                        {
                            密码[i] = (char)password.Password[i];
                            密码[i] ^= 密码[i];

                           
                           
                        }
                       
                       
                       
     
                    }

                    else
                    {
                        Console.WriteLine("文件为空");
                    }
                   

                }
                else
                {
                    throw new FileNotFoundException();
                }

            }
        }
        public class MainRun
        {
            static void Main()
            {
               加密的文件 anew = new 加密的文件(@"c:\1.txt");
     
            }
        }
    }

  • 相关阅读:
    使用工具进行计算机取证
    SpringBoot整合Swagger2
    Filebeat安装部署
    Mac OS X上使用Wireshark抓包
    maven集成命令-U -B -P -e -X
    轻量级Mysql Sharding中间件——Shark
    Spring MVC的WebMvcConfigurerAdapter用法收集(零配置,无XML配置)
    Unity2D音游案例-节奏大师教程+源码+素材
    4款五星级的3D模型资源包
    CandyCrush 糖果传奇源码+素材+教程
  • 原文地址:https://www.cnblogs.com/fat_li/p/1828573.html
Copyright © 2011-2022 走看看