UtilEncryptionEncryptFile(SymmetricAlgorithm, FileInfo, FileInfo, String) Method
Encrypts a file using the specified SymmetricAlgorithm
and writes the encrypted data to a destination file.
Namespace: DevCase.Core.Security.Cryptography.EncryptionAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void EncryptFile(
SymmetricAlgorithm algorithm,
FileInfo srcFile,
FileInfo dstFile,
string key
)
Public Shared Sub EncryptFile (
algorithm As SymmetricAlgorithm,
srcFile As FileInfo,
dstFile As FileInfo,
key As String
)
Dim algorithm As SymmetricAlgorithm
Dim srcFile As FileInfo
Dim dstFile As FileInfo
Dim key As String
UtilEncryption.EncryptFile(algorithm, srcFile,
dstFile, key)
public:
static void EncryptFile(
SymmetricAlgorithm^ algorithm,
FileInfo^ srcFile,
FileInfo^ dstFile,
String^ key
)
static member EncryptFile :
algorithm : SymmetricAlgorithm *
srcFile : FileInfo *
dstFile : FileInfo *
key : string -> unit
No code example is currently available or this language may not be supported.
Parameters
- algorithm SymmetricAlgorithm
-
The SymmetricAlgorithm.
- srcFile FileInfo
-
The source file.
- dstFile FileInfo
-
The destination file.
- key String
-
The key.
This is a code example.
No code example is currently available or this language may not be supported.
Dim srcFile As New FileInfo("C:\File.txt")
Dim dstFile As New FileInfo(String.Format("{0}.bin", srcFile.FullName))
Dim key As String = "MyKey"
Dim algorithm As New DESCryptoServiceProvider()
EncryptFile(algorithm, srcFile, dstFile, key)
' srcFile.Delete()
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentNullException
|
key
|