背景:博主本是一位Windows桌面应用程序开发工程师,对网络通信一知半解.一日老婆逛完某宝,问:"为什么他们知道我的地址呢,他们是怎么获取我的地址的呢?" 顺着这个问题我们的探秘开始: 第一步:简单的服务搭建 思路,通过HttpListener在本地搭建一个简易的服务器,开发程序为控制台接口,核心类 HttpListenerService: 方法 Start()开启线程池针对指定IP进行监听,本地的端口选取的9527(周星驰唐伯虎点秋香在华府的编号) public void Star
using Microsoft.Win32; using System; using System.Collections; using System.Collections.Generic; using System.Net.NetworkInformation; using System.Net.Sockets; namespace Common { public class NetworkHelper { /// <summary></summary> /// 显示本机各网卡