我有一個名爲「list」的列表數組。我需要將此列表轉換爲十六進制字符串。我嘗試了下面的代碼,但它沒有奏效。如何將列表數組轉換爲C#中的Hexstring?
var list = objIPLayer.Udp.Payload.ToList();
string hex = BitConverter.ToString(list);
我得到這個錯誤:
The best overloaded method match for
'System.BitConverter.ToString(byte[])'
has some invalid arguments** when executed the following code.string hex = BitConverter.ToString(list);
有沒有方法做到這一點?
什麼類型是你的名單? –
它的類型是字節。 **列表 **。 –
Mask
我得到這個錯誤**當執行下面的代碼時,'System.BitConverter.ToString(byte [])'的最佳重載方法匹配有一些無效參數**。 **字符串十六進制= BitConverter.ToString(列表); ** – Mask