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

  • 相关阅读:
    gulp安装
    ssh公钥自动登陆
    Laravel 依赖注入原理
    mac添加环境变量
    get和post的区别
    CPU进程与线程的关系和区别
    微信支付开发+{ping++}微信支付托管
    git学习笔记
    消除 activity 启动时白屏、黑屏问题
    转:android中APK开机自动运行
  • 原文地址:https://www.cnblogs.com/fat_li/p/1828573.html
Copyright © 2011-2022 走看看