Click here to Skip to main content
15,886,422 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Set a keyboard hook Pin
TheMrProgrammer1-Jul-09 5:36
TheMrProgrammer1-Jul-09 5:36 
QuestionHow to do a HTTP GET request Pin
fuhaizah30-Jun-09 18:37
fuhaizah30-Jun-09 18:37 
AnswerRe: How to do a HTTP GET request Pin
Christian Graus30-Jun-09 21:41
protectorChristian Graus30-Jun-09 21:41 
QuestionProblem reading CSV file into dataset. Pin
maf66630-Jun-09 11:10
maf66630-Jun-09 11:10 
AnswerRe: Problem reading CSV file into dataset. Pin
Johan Hakkesteegt1-Jul-09 2:30
Johan Hakkesteegt1-Jul-09 2:30 
GeneralRe: Problem reading CSV file into dataset. Pin
maf6661-Jul-09 3:20
maf6661-Jul-09 3:20 
QuestionVB.net 2005 (getModuleFileNameEx) Pin
johnl012930-Jun-09 9:41
johnl012930-Jun-09 9:41 
QuestionDeserialize PHP Encoded Data Pin
GGP130-Jun-09 9:32
GGP130-Jun-09 9:32 
I'm reading a SQL database created by a PHP app, and there are several columns of data that were Base64 encoded and serialzed. Using VB.NET I'm easily able to take a string of data and decode it, but then have a problem de-serializing the data. I need to do this all in memory, so I use a MemoryStream. But when this is run, it says the stream is not in a binary format.

I'm missing a step or two here???

System.Runtime.Serialization.SerializationException was unhandled
Message="The input stream is not a valid binary format. The starting contents (in bytes) are: 4F-3A-34-3A-22-69-74-65-6D-22-3A-34-3A-7B-73-3A-32 ..."
Source="mscorlib"

Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters
Imports System.BitConverterImports System.Text.RegularExpressions

Public Class Form1

 Private Sub testing()
 Dim OrderItem as string
 Dim ByteArray() As Byte
 Dim DecodedString As String
 Dim DeSerializedString as String

OrderItem  = "Tzo0OiJpdGVtIjo0OntzOjI6ImlkIjtpOjM0NjA3MztzOjg6InF1YW50aXR5IjtkOjE7czo3OiJvcHRpb25zIjthOjA6e31zOjU6InJlZ2lkIjtzOjA6IiI7fQ=="
ByteArray = System.Convert.FromBase64String(OrderItem)
DecodedString = System.Text.Encoding.ASCII.GetString(ByteArray) 

DeserialzedString = Deserialize(DecodedString)

End Sub

Private Function Deserialize(ByVal DecodedString As String) As String
        Dim bf As New Binary.BinaryFormatter()
        Dim ms As New IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(DecodedString))
        Return bf.Deserialize(ms)
End Function

End Class

AnswerRe: Deserialize PHP Encoded Data Pin
Dave Kreskowiak30-Jun-09 10:40
mveDave Kreskowiak30-Jun-09 10:40 
Questionresizing contols in a form Pin
sa_runner30-Jun-09 8:38
sa_runner30-Jun-09 8:38 
AnswerRe: resizing contols in a form Pin
Eslam Afifi30-Jun-09 9:48
Eslam Afifi30-Jun-09 9:48 
AnswerRe: resizing contols in a form Pin
Jon_Boy1-Jul-09 1:27
Jon_Boy1-Jul-09 1:27 
AnswerRe: resizing contols in a form Pin
sa_runner1-Jul-09 3:40
sa_runner1-Jul-09 3:40 
Questionhow to connect a database to VB.net with codes Pin
myperacq30-Jun-09 4:16
myperacq30-Jun-09 4:16 
AnswerRe: how to connect a database to VB.net with codes PinPopular
Tom Deketelaere30-Jun-09 4:27
professionalTom Deketelaere30-Jun-09 4:27 
GeneralRe: how to connect a database to VB.net with codes Pin
JC.KaNNaN30-Jun-09 18:20
JC.KaNNaN30-Jun-09 18:20 
QuestionDesktop background Pin
The real $M@30-Jun-09 3:35
The real $M@30-Jun-09 3:35 
AnswerRe: Desktop background Pin
Tom Deketelaere30-Jun-09 4:18
professionalTom Deketelaere30-Jun-09 4:18 
AnswerRe: Desktop background Pin
Sk9330-Jun-09 5:43
Sk9330-Jun-09 5:43 
AnswerRe: Desktop background Pin
chilinhhacker13-Jul-09 19:17
chilinhhacker13-Jul-09 19:17 
GeneralRe: Desktop background Pin
The real $M@14-Jul-09 5:25
The real $M@14-Jul-09 5:25 
Questiontv tuner and directShow Pin
gsipes30-Jun-09 3:30
gsipes30-Jun-09 3:30 
QuestionMultithreading confusion Pin
Sonhospa30-Jun-09 2:59
Sonhospa30-Jun-09 2:59 
AnswerRe: Multithreading confusion Pin
Luc Pattyn30-Jun-09 3:19
sitebuilderLuc Pattyn30-Jun-09 3:19 
QuestionRe: Multithreading confusion Pin
Sonhospa30-Jun-09 10:04
Sonhospa30-Jun-09 10:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.