Skip to main content

Hi, 

I need to convert a part of a program in VB and i need your help.

Dim st As New StreamReader(Fich.FullName)
xm = st.ReadToEnd
Dim enc As New System.Text.UTF8Encoding
Dim Buffer() As Byte = enc.GetBytes(xm)
Dim Filename As String = Convert.ToBase64String(Buffer, 0, Buffer.Length)
Console.WriteLine(wsSEF.EntregaBoletinsAlojamento(UH, Estabelecimento, ChaveAcesso, Convert.ToBase64String(Buffer, 0, Buffer.Length)))

I convert like this:

declare st = New StreamReader(Fich::FullName)
set xm to st::ReadToEnd
declare enc = New System.Text.UTF8Encoding

declare Buffer as byte occurs any = enc::GetBytes(xm)

set Buffer to enc::GetBytes(xm)
invoke type Console::WriteLine(wsSEF::EntregaBoletinsAlojamento(UH,Estabelecimento, ChaveAcesso, Convert::ToBase64String(Buffer, 0, Buffer::Length)))

Please tell me if is correct. I have no errors of compilation until the last line.

At the last line i have an erro in this part: "Convert::ToBase64String(Buffer, 0, Buffer::Length)". The error is OPERAND CONVERT IS NOT DECLARED.

I'm waiting for your comments and for your help.

Best regards,

Alberto Ferraz

Hi, 

I need to convert a part of a program in VB and i need your help.

Dim st As New StreamReader(Fich.FullName)
xm = st.ReadToEnd
Dim enc As New System.Text.UTF8Encoding
Dim Buffer() As Byte = enc.GetBytes(xm)
Dim Filename As String = Convert.ToBase64String(Buffer, 0, Buffer.Length)
Console.WriteLine(wsSEF.EntregaBoletinsAlojamento(UH, Estabelecimento, ChaveAcesso, Convert.ToBase64String(Buffer, 0, Buffer.Length)))

I convert like this:

declare st = New StreamReader(Fich::FullName)
set xm to st::ReadToEnd
declare enc = New System.Text.UTF8Encoding

declare Buffer as byte occurs any = enc::GetBytes(xm)

set Buffer to enc::GetBytes(xm)
invoke type Console::WriteLine(wsSEF::EntregaBoletinsAlojamento(UH,Estabelecimento, ChaveAcesso, Convert::ToBase64String(Buffer, 0, Buffer::Length)))

Please tell me if is correct. I have no errors of compilation until the last line.

At the last line i have an erro in this part: "Convert::ToBase64String(Buffer, 0, Buffer::Length)". The error is OPERAND CONVERT IS NOT DECLARED.

I'm waiting for your comments and for your help.

Best regards,

Alberto Ferraz

Try putting the keyword "type" in front of the Convert as Convert is a classname

type Convert::ToBase64String(Buffer, 0, Buffer::Length)))


Try putting the keyword "type" in front of the Convert as Convert is a classname

type Convert::ToBase64String(Buffer, 0, Buffer::Length)))

Thanks Chris.

There is no longer a compilation error and I think the upload is already being done.

It's giving an error in the return but I think it's from the recipient.
I will now try to see with him.

Best Regards
Alberto Ferraz

Thanks Chris.

There is no longer a compilation error and I think the upload is already being done.

It's giving an error in the return but I think it's from the recipient.
I will now try to see with him.

Best Regards
Alberto Ferraz

Not quite what you're looking for in this instance but if you ever need to go from C# to COBOL, try this:

https://cs2cobol.microfocuscloud.com/ 


Not quite what you're looking for in this instance but if you ever need to go from C# to COBOL, try this:

https://cs2cobol.microfocuscloud.com/ 

Hi Scot,

Thanks for the information.

I have already used this tool that is very handy.

Best regards

Alberto Ferraz