System .__ ComObject不转换....为什么这个例外?

时间:2014-11-12 12:13:50

标签: arrays vb.net object byte

I purpose, turn obj into byte array objects. But serialize method is error 

Dim obj As Object = Nothing
    昏暗数据As Byte()
    obj = getDocument(pid)'getdocument(pid) - >类型:Object,obj.value = System._Object     data = ObjectToByteArray(obj)

*****高级代码Form_Load *****

**Public Function ObjectToByteArray(obje As Object) As Byte()**    
Dim ms As New MemoryStream()    
Dim bf As New BinaryFormatter()    
bf.Serialize(ms, obje)              ******Exeption Error**
Return ms.ToArray()    
**End Function**

我的例外是:在程序集'mscorlib中键入'System._ComObject',版本= 4.0.0.0 Culture = neutral,PublicKeyToken = b77a5c561934e089'未标记为可预订的

0 个答案:

没有答案