FromBase64String method?

Byak@

Active Member
Licensed User
i want convert a int64 string (for example "Bwt693756BjBJsJ87coat7JArS0=") to bytes. in c# we can use a method System.Convert.FromBase64String and what about b4ppc?
 

Byak@

Active Member
Licensed User
thanks Andrew
 

Byak@

Active Member
Licensed User
hmm...
i'm write a pop3client module for b4ppc.working with pop3 protocol good.
now i'm try to decode a MIME and save attachments from recived messages. but i can't...
it is a string,contain a base64 of file (jpg image)
B4X:
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEP
ERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/wAALCAB4AHgBAREA/8QAHQAAAQUBAQEB
AAAAAAAAAAAABwADBAUGCAIBCf/EADsQAAEDAwMBBgMHAgQHAAAAAAECAwQABREGEiExBxMiQVFh
FDJxCEKBkaGxwSNSFRYk8VNicsLR4fD/2gAIAQEAAD8A7LpUqVKlSqNcpLEOI5JkuBtltJUtR8hX
NXavql2+XJeFuJhoUQy2RkY9SM8E0I7t3YLh2EOHnHlWQumFvKLjhCs9PSqO5MbABtQk9efvZ6Vm
nHVNygWclYOcDyNGvsa7dH7Etq0alBk21RShMhJy5HHTJH3k/qK6liSY0+GzMhyG347yAttxCspU
k8gg0WqVKlSpUqwPbDOWm0t25C9vfZW5z5DoPz/agNe2UpwlwBSVp8uoofakRtTnIyDxisXNUkSA
lYKgVckdaor0XJjpdbw2naSE7sYSP5rMTZKGRtS1lRHKjkUrW2h9DzgSEqbGAkjI5FdYfY/1Gq6a
Dm2OQ+XH7TK2oSojIaWMp/AEKrsClSpUqVfFdKFHaNIVJujyiApDf9NOemB1/XNCzUEZTpJTwBwn
6E0ONT4DWSnqCQr1oaX2UttwkJOAc/WsxIvDkXvEqVuBBGPQHyFVpQ1NjgtO/wCocd2hHOcY/wB6
nwRGi25CFp2zC5/WUc8I6Yx/90o2/Y9fRF7RbzCSF7ZduSsHqMpUDyfxNd9V4dcS2grUc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H
60cPs9TpL1q1Rbp7yn5dv1JNadUrkncvdk/Uk0TF8DPlTZNeFnPlXjmvJBxkgV//2Q==
for saving i'm use code
B4X:
Sub Globals
Dim arr(0) As byte
End Sub

Sub App_Start
form1.Show
b64.New1
End Sub

Sub bgo_click
FileOpen(c,AppPath&"\1.jpg",cRandom)
bin.New2(c,20127)
s=b64.Base64ToString(StrReplace(tb1.Text,CRLF,""))
arr()=bin.StringToBytes(s)
bin.WriteBytes(arr())
FileClose(c)
AppClose
End Sub
but saved file is corrupted =(
what wrong?
 

Attachments

  • pop3.zip
    4.8 KB · Views: 200

Byak@

Active Member
Licensed User
Yes!Thanks Andrew,now it's work!
 

Byak@

Active Member
Licensed User
desctop and device) i'm complit it and tomorrow i'm share this module. or maybe today,if i'm found a time
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…