Visual Basic 6.0
Visual Basic 6.0
Append Encoded Binary Data to StringBuilder
Demonstrates how to append encoded binary data to the contenets of a StringBuilder.Chilkat Visual Basic 6.0 Downloads
Dim success As Long
success = 0
Dim bd As New ChilkatBinData
success = bd.LoadFile("qa_data/jpg/starfish.jpg")
If (success = 0) Then
Debug.Print "Failed to load file."
Exit Sub
End If
' For example, let's say we want construct simple JSON containing the base64 representation of the above JPG file.
Dim sb As New ChilkatStringBuilder
success = sb.Append("{ ""jpg"": """)
' GetEncodedSb appends the enocded representation of the binary data to the StringBuiler passed in the 2nd arg.
success = bd.GetEncodedSb("base64",sb)
success = sb.Append(""" }")
Debug.Print sb.GetAsString()
' Output looks like this:
' { "jpg": "/9j/4AAQSkZJRgABAg...rcQ+vo//2Q==" }