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. Trouble checking virtual server(vps) connection with qt
Forum Updated to NodeBB v4.3 + New Features

Trouble checking virtual server(vps) connection with qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 3.1k Views 1 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.
  • M Offline
    M Offline
    MrErfan
    wrote on 7 Sept 2017, 19:23 last edited by
    #1

    I want to enter in the program, ip, username and password of a virtual server(vps), and the program checks that the username and password are correct or not.

    I used the following code

    void MainWindow::test(){
    QLoggingCategory::setFilterRules("qt.network.ssl.warning=false");
    QNetworkAccessManager* manager = new QNetworkAccessManager(this);
    QUrl url;
    url.setHost("xx.xxx.xx.xx");
    url.setPort(3389);
    url.setUserName("administrator");
    url.setPassword("xxxx");
    manager->get(QNetworkRequest(url));
    connect(manager,&QNetworkAccessManager::finished, this, &MainWindow::connFinished);
    }
    

    output: QNetworkReply::NetworkError(ProtocolUnknownError)

    please guide me

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Sept 2017, 19:43 last edited by
      #2

      Hi,

      Looks like you are missing a scheme in your url. You can set one using QUrl::setScheme.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MrErfan
        wrote on 7 Sept 2017, 20:45 last edited by MrErfan 9 Jul 2017, 20:53
        #3

        tnx my bro ,
        I'm really confused , This is for the FTP protocol.
        I want to give ip a virtual server, username, password to the program and if the username or password is incorrect, the program will display an error message.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 Sept 2017, 20:53 last edited by
          #4

          Then set the scheme to ftp. An URL to be complete needs a scheme otherwise you are basically asking QNAM to guess how it should communicate with a remote computer.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • M Offline
            M Offline
            MrErfan
            wrote on 7 Sept 2017, 21:07 last edited by MrErfan 9 Jul 2017, 21:10
            #5

            I tested a virtual server with RemoteDesktopConnection without a connection problem.
            I am modifying the IP address and username and password in the following code

            void MainWindow::test()
            {
                QLoggingCategory::setFilterRules("qt.network.ssl.warning=false");
                QNetworkAccessManager* manager = new QNetworkAccessManager(this);
                QUrl url;
                url.setScheme("ftp");
                url.setHost("37.143.xx.xx");
                url.setPort(3389);
                url.setUserName("administrator");
                url.setPassword("xx");
                manager->get(QNetworkRequest(url));
                connect(manager,&QNetworkAccessManager::finished, this, &MainWindow::connFinished);
            }
            void MainWindow::connFinished(QNetworkReply *reply)
            {
                qDebug() << reply->error();
            }
            

            outpute : QNetworkReply::NetworkError(ContentOperationNotPermittedError)

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 7 Sept 2017, 21:11 last edited by
              #6

              @MrErfan said in Trouble checking virtual server(vps) connection with qt:

              ContentOperationNotPermittedError

              Having remote desktop running and having a FTP server running is not the same thing.

              What are you expecting to get from that request ?

              Can you connect a FTP client on that exact URL ? If so what do you get ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • M Offline
                M Offline
                MrErfan
                wrote on 7 Sept 2017, 21:15 last edited by MrErfan 9 Jul 2017, 21:16
                #7

                @SGaist said in Trouble checking virtual server(vps) connection with qt:

                Having remote desktop running and having a FTP server running is not the same thing.
                What are you expecting to get from that request ?
                Can you connect a FTP client on that exact URL ? If so what do you get ?

                What I want to do does not have to do with FTP :D
                I just want to check if the username and password of the server(VPS) I'm logging in are correct.
                Sorry i am a beginner :(

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 7 Sept 2017, 21:54 last edited by
                  #8

                  If you want to log into something you have access that something through a service that allows that so just connecting to a box won't give you that.

                  What exactly is running on your remote box ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    MrErfan
                    wrote on 7 Sept 2017, 22:40 last edited by MrErfan 9 Jul 2017, 22:40
                    #9

                    I do not want to do anything special; I just want to check with my Qt library whether the user's virtual server and password are correct or wrong.
                    0_1504824010247_b74a338c-9e1e-41a3-b1c3-6f65f0e8f741-image.png

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      MrErfan
                      wrote on 7 Sept 2017, 23:27 last edited by
                      #10

                      It's as if the Qt do not have a module for working with the RDP protocol

                      VRoninV 1 Reply Last reply 8 Sept 2017, 07:46
                      0
                      • M MrErfan
                        7 Sept 2017, 23:27

                        It's as if the Qt do not have a module for working with the RDP protocol

                        VRoninV Offline
                        VRoninV Offline
                        VRonin
                        wrote on 8 Sept 2017, 07:46 last edited by
                        #11

                        @MrErfan said in Trouble checking virtual server(vps) connection with qt:

                        It's as if the Qt do not have a module for working with the RDP protocol

                        BINGO!

                        RDP is a Microsoft proprietary system and the API is not libre. On top of that it's Windows only so it's out of scope for this library.

                        There APIs provided by Microsoft for dealing with that service here: https://msdn.microsoft.com/en-us/library/aa383494(v=vs.85).aspx

                        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                        ~Napoleon Bonaparte

                        On a crusade to banish setIndexWidget() from the holy land of Qt

                        1 Reply Last reply
                        2

                        1/11

                        7 Sept 2017, 19:23

                        • Login

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