WinPcap 4.0.1 Online Chinese manualStart
This article takes Visual Studio 2013 and WinPcap 4.1.3 as an example, for both 32-bit and 64-bit Win7 Universal
1. Download and install the WinPcap Runtime Library
Http://www.winpcap.org/install/default.htm
Some packet capture software will be bundled with the installation of Winpcap,mentohust also comes with WinPcap, in which case you can generally skip this step.
2. Download WinPcap Development Package
Http://www.winpcap.org/devel.htm
Unzip to the plain English path and get the directory structure shown in 1:
3. New Project
Open Visual Studio with Administrator privileges, create a new Visual C + + WIN32 Console application, set to Empty project, 2:
4. Set up the project
Open the project properties, as shown in 3, WPCAP
and HAVE_REMOTE
define the two macros:
5. Add
wpcap.lib
And
ws2_32.lib
Two of libraries.
6. Add the Include path (that is, figure 1
Include
directory) and the library path (that is, figure 1
Lib
Directory):
7. Setting up UAC
This step is not required, but recommended settings. Allows the generated program to automatically trigger the Administrator Permissions dialog box. In any case, the resulting program will need to run with administrator privileges.
8. Complete
After completing the above steps and clicking OK to save the settings, add the required source files to the project. For example, create a new C + + source file (you can also add an existing one)
Tips:Question 1
For the hint of the use of scanf unsafe problem: can be scanf
changed to scanf_s
, or directly in front of the #include<stdio.h>
#define _CRT_SECURE_NO_WARNINGS
warning can not be reported
Question 2
After selecting the network card after the error, the program is interrupted, presumably: you need to select the active network card, according to the model of the network card to determine the local connection, you can refer to the "Open Network and Sharing Center" in the order of the adapter.
Code sampleCourse Design of computer networkReference:
http://blog.csdn.net/kxcfzyk/article/details/20129867
Visual Studio Configuration WinPcap Environment