IEnumerable en = (IEnumerable) myObject; byte[] myBytes = en.OfType<byte>().ToArray();
TypeConverter objConverter = TypeDescriptor.GetConverter(objMsg.GetType()); byte[] data = (byte[])objConverter.ConvertTo(objMsg, typeof(byte[]));
Powered by: 博客园 Copyright © 2024 颍川小哥 Powered by .NET 8.0 on Kubernetes