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");
     
            }
        }
    }

  • 相关阅读:
    《面试题 03.05. 栈排序》——惰性更新
    CTF<密码学> writeup 传统知识+古典密码
    有趣的数学(二)
    【】Dedecms友情链接去掉LI的方法介绍
    【】【】打工子弟学校学生们的中国梦何时圆?
    Discuz! 7.2 防注册机注册+发垃圾帖的解决方法
    Windows 8 常用快捷键
    Win7 64位系统下Auto CAD 2010注册激活,出现警告:Make sure you can write to current directory...
    怎么从EXCEL或WORD里提取图片?
    如何将windows xp系统下的outlook express6.0的邮件,帐号及通迅录导入Office Outlook xp/2003/2007中...
  • 原文地址:https://www.cnblogs.com/fat_li/p/1828573.html
Copyright © 2011-2022 走看看