Sample code for 30+ languages & platforms
VB.NET

Load Entire File into BinData

Demonstrates how to load an entire file into a BinData object.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim fac As New Chilkat.FileAccess

success = fac.OpenForRead("qa_data/pdf/sample.pdf")
If (success = False) Then
    Debug.WriteLine(fac.LastErrorText)
    Exit Sub
End If


Dim bd As New Chilkat.BinData
Dim maxBytesToRead As Integer = 99999999
success = fac.FileReadBd(maxBytesToRead,bd)
If (success = False) Then
    Debug.WriteLine(fac.LastErrorText)
    Exit Sub
End If


fac.FileClose()

' The bd object contains the file data...
success = bd.WriteFile("qa_output/sample.pdf")