1 假設您有一個System.Net.Sockets.Socket對象,請將其RemoteEndPoint屬性鍵入IPEndPoint,然後閱讀其Port屬性。 來源 2011-04-25 20:08:08
0 要聽一個插座,你不需要知道的端口號先? 來源 2011-04-25 17:53:35 +0 當然,但我需要客戶端端口NAT穿透服務器。我不需要客戶端程序綁定的端口,但需要路由器的一個連接 – Stefano 2011-04-25 18:38:50 +0 然後,我建議您去http://www.rfc-editor.org/rfcsearch.html並搜索「NAT」和/或「網絡地址轉換」。並通過RFC工作。另見http://en.wikipedia.org/wiki/NAT_traversal – 2011-04-25 19:18:47
當然,但我需要客戶端端口NAT穿透服務器。我不需要客戶端程序綁定的端口,但需要路由器的一個連接 – Stefano 2011-04-25 18:38:50
然後,我建議您去http://www.rfc-editor.org/rfcsearch.html並搜索「NAT」和/或「網絡地址轉換」。並通過RFC工作。另見http://en.wikipedia.org/wiki/NAT_traversal – 2011-04-25 19:18:47