ASP.NET Fax – Submit Binary Document (VB.NET code)
This code sample demonstrates how to submit a binary ASP.NET fax, using VB.NET (.aspx.vb extension). This is done using the SendBinaryDocument method.
The SendBinaryDocument method also indicates whether your submission was successful by returning the transaction ID (positive number) of the fax in the system. If any other value is returned, the submission failed (see Web Service Return Codes for more details).
The following snippet sends an ASP.NET fax in binary format using VB.NET (aspx.vb), and indicates whether the submission was successful:
Dim username As String = "my username" Dim password As String = "my password" Dim faxnumber As String = "+442079876543" 'dim b as byte() = System.IO.File.ReadAllBytes("c:\temp\1.pdf") Dim b As Byte() = System.Text.Encoding.ASCII.GetBytes("This is my text") Dim ifws As New interfax.InterFax() Dim st As Long = ifws.Sendfax(username, password, faxnumber, b, "txt") Response.Write("Status is " & st) End Sub End Class