在BCB中将文本文件按行(不考虑空行)加密
来源:互联网 发布:如何仿真网络性能测试 编辑:程序博客网 时间:2024/04/29 22:32
按行加密的前提是按行读取,下面实现按行读取(请注意:你很可能运行不了下面的程序,因为我估计你没有安装BCB):
//---------------------------------------------------------------------------#include <vcl.h>#pragma hdrstop#include <fstream>#include <string>#include <iostream>using namespace std;#include "Unit1.h"//---------------------------------------------------------------------------#pragma package(smart_init)#pragma resource "*.dfm"TForm1 *Form1;//---------------------------------------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner){}//---------------------------------------------------------------------------void __fastcall TForm1::Button1Click(TObject *Sender){ ifstream in("computer.cfg");ofstream out("another.cfg");string filename;string line; while (getline (in, line)) { if("" != line) { out << line << endl; } }}//---------------------------------------------------------------------------
经测试,上面的程序正确。加密其实就是变换,无需多说。
- 在BCB中将文本文件按行(不考虑空行)加密
- C++计算文件的行数 不考虑空行
- 删除文本文件空行
- C++删除文本文件空行
- C++删除文本文件空行
- 去掉txt文本文件中的空行和重复的行
- JAVA 删除文本文件中的空行
- [VB.NET]如何清除文本文件中的空行
- linux/shell 文本文件删除/删掉空行
- JPetStore在Tomcat上部署方法(不考虑Eclipse及Struts或Spring)
- java 文本文件加密 文本文件解密
- 用BCB读写文本文件及ini配置文件
- bcb最佳des加密方法
- 文本文件加密解密(一)
- 给文本文件加密解密
- C++对文本文件加密
- 文件分割,用于将一个文件产生k份文档(仿linux的split,考虑遇到空行再分开)
- 【2010年1月6日】编写文件打包工具程序,加密暂时不考虑
- 单链表的逆置
- 工程项目利用AutoMake生成Makefile实战
- 回调函数
- jquery.cookie使用方法
- 设计一个移动应用的本地缓存机制
- 在BCB中将文本文件按行(不考虑空行)加密
- 深入分析ConcurrentHashMap
- 国内外三个不同领域巨头分享的Redis实战经验及使用场景
- 在32位Windows 8或Windows 7上安装Windows Phone 8 SDK
- 修改tomcat的端口
- CODE 70: Unique Paths II
- 网页文本 编辑器 KindEditor NicEditor
- 【Deep Learning学习笔记】Dynamic Auto-Encoders for Semantic Indexing_Mirowski_NIPS2010
- 安装efence库