Solved Access folder network in Windows
-
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 youEdit:
I'm using QT 5.7 on Windows -
@Gianluca86 The easiest way is actually to map that network share to a drive letter and access it then like any other path.
-
-
If it's only Windows you could use MSDN WNetAddConnection2
-
-
easy as using Qt methods ;)
just include the neccessary header files in your source code and add the libs to the pro file.