各位前輩:
小弟以 VB6 的 Winsock 控制項 (名稱: tcpServer) 撰寫 Server 的程式, 想要知道有那些 Client 連接上來, 在其 tcpServer 的 ConnectionRequest 事件中, 撰寫以下程式:
  .....
  tcpServer(SocketIndex).Accept requestID
  .....
  ' SocketIndex 指的是 Client 連結後的 Socket Number
  Debug.Print tcpServer(SocketIndex).RemoteHost & Space(4) & tcpServer(SocketIndex).RemoteHostIP & Space(4) & tcpServer(SocketIndex).RemotePort
  但卻發現 只有 tcpServer(SocketIndex).RemoteHostIP 與 tcpServer(SocketIndex).RemotePort 有值;
  不知應如何取得 Client 的 HostName?
  煩請各位前輩協助, 謝謝.
arrow
arrow
    全站熱搜

    vbqa 發表在 痞客邦 留言(1) 人氣()