Skip to content

csuzhhj/C--reads-IP-and-Comport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

C++-reads-IP-addresses

Using Visual Studio C++ to read IP addresses on Windows platform

HOW TO USE:

#include"GetIp.h"

int main() {
	cout << getip() << endl;//Print IP Address
}

Possible errors: Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings XXX

Solution: Open the project properties, edit the preprocessor definition, and add: _WINSOCK_DEPRECATED_NO_WARNINGS

C++ reads the serial number of the computer

Using Visual Studio C++ to read the serial number of the computer on Windows platform

HOW TO USE:

#include"GetComport.h"

int main() {
    vector<string> comport = getComPort();
    for (int i = 0; i < comport.size(); i++) {
        cout << comport[i] << endl;//Print the serial port number
    }
}

About

Using Visual Studio C++ to read IP addresses and comport number (Serial number) on Windows platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages