- Page Content
- Introduction
Let's exemplify in VB.NET the base64 string generation of the contents of a file.
Dim fs As New System.IO.FileStream(“c:\teste.pdf”, IO.FileMode.Open, IO.FileAccess.Read)
Dim buffer() As Byte = Nothing
buffer = New Byte(fs.Length) {}
fs.Read(buffer, 0, fs.Length)
Dim conteudoArquivo As String = Nothing
conteudoArquivo = Convert.ToBase64String(buffer, 0, fs.Length)
fs.Close()
The string conteudoArquivo will contain the contents of the specified file in base64 format. In this way it can be placed in an XML to auto register in QualiSign Portal.