CryptoSys API examples VB6 to VB.NET

WIPE_String

A VB6 alias for WIPE_Data.

VB6/VBA

Debug.Print "Testing WIPE_Data ..."
Dim strData As String
Dim nRet As Long
strData = "my deepest secrets"
Debug.Print "Before WIPE_String: " & "[" & strData & "]"
nRet = WIPE_String(strData, Len(strData))
' Set to empty as well...
strData = ""
Debug.Print "After WIPE_String:  " & "[" & strData & "]"

Output

Testing WIPE_Data ...
Before WIPE_String: [my deepest secrets]
After WIPE_String:  []

VB.NET

Console.WriteLine("Testing WIPE_Data ...")
''Dim strData As String
''Dim nRet As Integer
' [VB.NET] In .NET you can only wipe a StringBuilder
Dim sb As New System.Text.StringBuilder
sb.Append("my deepest secrets")
Console.WriteLine("Before WIPE_String: " & "[" & sb.ToString & "]")
Wipe.String(sb)
Console.WriteLine("After WIPE_String:  " & "[" & sb.ToString & "]")

[Contents]

[HOME]   [NEXT: ZLIB_Deflate...]

Copyright © 2009-20 D.I. Management Services Pty Ltd. All rights reserved.