UtilEncryptionEncryptFile(SymmetricAlgorithm, String, String, 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,
string srcFilepath,
string dstFilepath,
string key
)
Public Shared Sub EncryptFile (
algorithm As SymmetricAlgorithm,
srcFilepath As String,
dstFilepath As String,
key As String
)
Dim algorithm As SymmetricAlgorithm
Dim srcFilepath As String
Dim dstFilepath As String
Dim key As String
UtilEncryption.EncryptFile(algorithm, srcFilepath,
dstFilepath, key)
public:
static void EncryptFile(
SymmetricAlgorithm^ algorithm,
String^ srcFilepath,
String^ dstFilepath,
String^ key
)
static member EncryptFile :
algorithm : SymmetricAlgorithm *
srcFilepath : string *
dstFilepath : string *
key : string -> unit
No code example is currently available or this language may not be supported.
Parameters
- algorithm SymmetricAlgorithm
-
The SymmetricAlgorithm.
- srcFilepath String
-
The source filepath.
- dstFilepath String
-
The destination filepath.
- 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.FullName, dstFile.FullName, 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
|