Docker Engine 有官方檔案https://docs.docker.com/engine/api/v1.41/#tag/Container/operation/ContainerCreate
我嘗試創建符合此描述的 .NET 結構的任何嘗試都失敗了,我收到各種錯誤,例如“無法將數字解組到 Go struct field ContainerConfigWrapper.ExposedPorts of type nat.PortSet”
我想定義結構
Public Property Hostname As String
...
Public Property ExposedPorts As ???
而不是使用這些資料作為引數
PostData = JsonConvert.SerializeObject(PostPrm)
Dim Response = Encoding.UTF8.GetString(Request.UploadData(URL, Encoding.UTF8.GetBytes(PostData)))
但是如何用 .NET 描述結構 ExposedPorts?
uj5u.com熱心網友回復:
它本質上是一個字典型別,鍵型別為字串和一個空物件。這是該頁面的檔案:
object or null
An object mapping ports to an empty object in the form:
{"<port>/<tcp|udp|sctp>": {}}
所以在 VB.NET 中,ExposedPorts 屬性看起來像:
Public Property ExposedPorts As Dictionary(Of String, Object)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/524202.html
標籤:json。网码头工人
上一篇:如何將一個目錄中的所有子檔案夾移動到c#中的另一個檔案夾?
下一篇:將相同介面型別的陣列注入類建構式
