Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Release app with another mac address in Qt
Forum Updated to NodeBB v4.3 + New Features

Release app with another mac address in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 406 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SeyMohsenFls
    wrote on last edited by
    #1

    Hello friends. I have a application that works with the system MAC address. If the Mac address is not the same, the application will not work. I want to release this application with another MAC address in my Qt. But I can not because it says the MAC address is not the same.
    How do I solve this problem?

    artwawA jsulmJ 2 Replies Last reply
    0
    • S SeyMohsenFls

      Hello friends. I have a application that works with the system MAC address. If the Mac address is not the same, the application will not work. I want to release this application with another MAC address in my Qt. But I can not because it says the MAC address is not the same.
      How do I solve this problem?

      artwawA Offline
      artwawA Offline
      artwaw
      wrote on last edited by
      #2

      @SeyMohsenFls if its your code you should be able to fix it? You didn't show any code we can work with.

      For more information please re-read.

      Kind Regards,
      Artur

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SeyMohsenFls
        wrote on last edited by
        #3
        bool check=false;
        foreach(QNetworkInterface netInterface, QNetworkInterface::allInterface)
        {
            if(!(netInterface.flag() & QNetworkInterface::IsLoopBack))
            {
                if(netInterface.HardwareAddress()=="00:00:00:00:00:00")
                {
                    check=true;
                    break;
                }
            }
            
            if(check==true)
            {
                chart *w=new Chart(nullptr);
                w->show();
            }
            else{
                QMessageBox::warning(nullptr,"Error","Mac address error");
            }
        }
        
        1 Reply Last reply
        0
        • S SeyMohsenFls

          Hello friends. I have a application that works with the system MAC address. If the Mac address is not the same, the application will not work. I want to release this application with another MAC address in my Qt. But I can not because it says the MAC address is not the same.
          How do I solve this problem?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @SeyMohsenFls said in Release app with another mac address in Qt:

          If the Mac address is not the same

          Same as what? Do you mean your app should only work if the MAC address has a specific value? So, it should only work on one specific machine? If so, you can use define at compile time: -DMAC="00:00:00:00:00:00" and then use MAC in your code.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi
            Do you know the next MAC address the app should work on?

            If this is for app protection it won't be very solid.

            Can you explain why you did this check ?

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved