Search code examples
vb.netnamed-pipesinter-process-communicat

Transfer Object by using NamePipe [Inter-Process Communication] VB.NET


So far i have done the part that able to let me transfer text between the sender & receiver. Is there anyway to transfer an object by using namepipe? eg. arraylist


Solution

  • In vb.net you can also do this like C ….

    Use serialize object and convert it to byte array transfer it and Deserialize on other end

    Serialize

    Dim BytArray() As Byte
    Using MS As MemoryStream = Memory.Serialize(_Object)
         BytArray = MS.GetBuffer()
    End Using
    

    Deserialize

    Dim _Return As objType = Nothing
    Using MS As System.IO.MemoryStream = New System.IO.MemoryStream(BytArray)
        _Return = Memory.Deserialize(Of objType)(MS)
    End Using