Ask question

Ask Questions and Get Answers from Our Community

Answer

Answer Questions and Become an Expert on Your Topic

Contact Staff

Our Experts are Ready to Answer your Questions

C++ Otomatik Makine Ip Tespiti

nyami

Yeni Üye
Katılım
20 May 2022
Mesajlar
10
Tepki
8
Puan
3
Credits
126
Points
50
common/service.h:
C++:
//Ekle

#define ENABLE_AUTODETECT_INTERNAL_IP                // AutoDetect Local Machine IP

config.cpp:
C++:
//Arat

    if (g_szPublicIP[0] != '0')

        return true;

    else

        return false;

C++:
//Değiştir

    if (g_szPublicIP[0] != '0')

        return true;

    else

    {

#ifdef ENABLE_AUTODETECT_INTERNAL_IP

        if (g_szInternalIP[0] == '0')

            return false;

        else

        {

            strlcpy(g_szPublicIP, g_szInternalIP, sizeof(g_szPublicIP));

            fprintf(stderr, "INTERNAL_IP -> PUBLIC_IP: %s\n", g_szPublicIP);

            return true;

        }

#else

        return false;

#endif

    }
 
Son düzenleme:

Şu anda bu konu'yu okuyan kullanıcılar

Üst