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. Access folder network in Windows

Access folder network in Windows

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 4.7k 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.
  • Gianluca86G Offline
    Gianluca86G Offline
    Gianluca86
    wrote on last edited by Gianluca86
    #1

    Hello everyone,
    I would like access to a folder (copy in the files or read) that resides on a computer connected to the local network.
    To read the folder I use the normal command:

    if(!QDir(QDir::toNativeSeparators("//192.168.0.20/FOLDER")).exists())
    {/
        qDebug()<<"Not Exist";
    }
    

    But since I have to enter username and password, I always find that the folder doesn't exist.
    How do I have to enter this data? I tried to use QNetworkManager, but it didn't work (maybe I did not understand how to implement it correctly)
    it's possible to do it? Are there examples?
    thank you

    Edit:
    I'm using QT 5.7 on Windows

    jsulmJ the_T 2 Replies Last reply
    0
    • Gianluca86G Gianluca86

      Hello everyone,
      I would like access to a folder (copy in the files or read) that resides on a computer connected to the local network.
      To read the folder I use the normal command:

      if(!QDir(QDir::toNativeSeparators("//192.168.0.20/FOLDER")).exists())
      {/
          qDebug()<<"Not Exist";
      }
      

      But since I have to enter username and password, I always find that the folder doesn't exist.
      How do I have to enter this data? I tried to use QNetworkManager, but it didn't work (maybe I did not understand how to implement it correctly)
      it's possible to do it? Are there examples?
      thank you

      Edit:
      I'm using QT 5.7 on Windows

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

      @Gianluca86 The easiest way is actually to map that network share to a drive letter and access it then like any other path.

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

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        Qt does not support samba natively. See some hints here, here and here

        (Z(:^

        1 Reply Last reply
        3
        • Gianluca86G Gianluca86

          Hello everyone,
          I would like access to a folder (copy in the files or read) that resides on a computer connected to the local network.
          To read the folder I use the normal command:

          if(!QDir(QDir::toNativeSeparators("//192.168.0.20/FOLDER")).exists())
          {/
              qDebug()<<"Not Exist";
          }
          

          But since I have to enter username and password, I always find that the folder doesn't exist.
          How do I have to enter this data? I tried to use QNetworkManager, but it didn't work (maybe I did not understand how to implement it correctly)
          it's possible to do it? Are there examples?
          thank you

          Edit:
          I'm using QT 5.7 on Windows

          the_T Offline
          the_T Offline
          the_
          wrote on last edited by
          #4

          @Gianluca86

          If it's only Windows you could use MSDN WNetAddConnection2

          -- No support in PM --

          1 Reply Last reply
          1
          • Gianluca86G Offline
            Gianluca86G Offline
            Gianluca86
            wrote on last edited by
            #5

            Thank you all for the answers.
            @sierdzio : Thanks for the link, now all I need is for Windows, but when I pass on to the linux will be very useful.
            @the_ : I don't understand how you can use a Windows function in Qt

            In any case, to resolve the problem quickly I turn off password protected sharing.

            the_T 1 Reply Last reply
            0
            • Gianluca86G Gianluca86

              Thank you all for the answers.
              @sierdzio : Thanks for the link, now all I need is for Windows, but when I pass on to the linux will be very useful.
              @the_ : I don't understand how you can use a Windows function in Qt

              In any case, to resolve the problem quickly I turn off password protected sharing.

              the_T Offline
              the_T Offline
              the_
              wrote on last edited by
              #6

              @Gianluca86

              easy as using Qt methods ;)

              just include the neccessary header files in your source code and add the libs to the pro file.

              -- No support in PM --

              1 Reply Last reply
              1

              • Login

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