在c#中加密文件最简单的方法是什么? [英] What's the easiest way to encrypt a file in c#?

查看:102
本文介绍了在c#中加密文件最简单的方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前:

我已经确定了其他关于SO的主题,但我找不到答案。

(其他都是关于配置文件或技术列表)

I have read indeed the other topics on SO, but I can't find an answer in them.
(The others are about config-files, or a list of techniques)

我的问题非常简单,虽然有点主观(我会提前标注:-))

My question thus is very simple, though a bit subjective (I'll label it beforehand :-)) what is the easiest way..

推荐答案

File.Encrypt 很简单 - 一个调用(一个参数)。

File.Encrypt is pretty simple - one call (with one parameter).

当然,这真的取决于你想要加密的内容。 File.Encrypt加密到当前帐户,如果你传递文件不是很多。但是,鉴于您的规范 - 即最简单的加密文件的方式 - 它必须是候选人!

Of course, it really depends on what you want the encryption for. File.Encrypt encrypts to the current account, which isn't much use if you're passing the file around. But, given your spec - i.e. easiest way to encrypt a file - it has to be a candidate!

这篇关于在c#中加密文件最简单的方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆