區域網獲取服務端IP

2021-05-26 20:47:27 字數 577 閱讀 9396

(1)客戶端**

#include "iostream"

#include "winsock2.h"

using namespace std;

#pragma comment(lib, "ws2_32.lib")

#define getip 0x101

#define sentip 0x102

typedef struct

ippack;

int main()

} cout<

(2)服務端**

#include "iostream"

#include "winsock2.h"

using namespace std;

#pragma comment(lib, "ws2_32.lib")

#define getip 0x101

#define sentip 0x102

typedef struct

ippack;

int main()

return 0;

}

Python獲取無線區域網IP

本文記錄使用python獲取本機ip的兩種方法。import socket print socket.gethostbyname socket.gethostname 此方法是先獲取hostname,然後在通過hostname來檢視本機的ip。不推薦此方法,因為若是在 etc hosts中將host...

python獲取區域網IP位址

設計思路 設計乙個udp資料報,併發送到公共的dns伺服器當中,udp資料報是盡最大努力不可靠交付,我們只需要獲取到udp頭部資訊即可 import socket def main get wlan ip def get wlan ip try socket.sock dgram代表的是socket...

區域網IP查詢

1.linux區域網ip查詢 nmap sp 192.168.1.0 24 查詢192.168.1段內可ping通的所有ip並列印到螢幕上,還有很多引數,具體如下 il 從主機 網路列表中輸入 ir 選擇隨機目標 exclude 排除主機 網路 excludefile 從檔案中排除列表 host d...