My problem is that.
I need to develop a programming connect to server to get Video, but server request UserName, PassWord. I don't know how to slove this. I use QtcpSocket
thanks so much
My problem is that.
I need to develop a programming connect to server to get Video, but server request UserName, PassWord. I don't know how to slove this. I use QtcpSocket
thanks so much
Without knowing the transmission protocol nor your code there is nothing we can do for you.
thanks
this is my codeif we don't have userName,passWord everyone can connect and get my private data?Qt Code:
void Hello::connect(char* serverName, int port){ QTcpSocket socket; //socket.connectToHost(serverName,port); if(socket.waitForConnected(6000)==true) { qDebug()<<"Successfully"; } else{ qDebug()<<socket.errorString(); return; }To copy to clipboard, switch view to plain text mode
thanks
Still not enough information. What kind of protocol do you want to use? Http, Ftp, Nntp, ... ?
No, what do you use on top of TCP?
Then I think you may want to use some higher level class such as QNetworkAccessManager or QFtp instead of QTcpSocket as I think you know FTP protocol requires at least two sockets.
I don't know if this is a homework or not but this quote from C++ FAQ LITE gives the general idea:
"If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm."
Read the documentation then do it yourself. If you get stuck, ask a specific question!!!
Misha R.evolution - High level Debugging IDE
Programming is about 2 basic principles: KISS and RTFM!!!
Then you need to figure out how the VC++ project uses FTP, and see if you can replace that code with QFTP class. Once you have done that research, if it does not work for you, state why and maybe we can help.
Last edited by nthung; 26th May 2010 at 18:45.
If this program indeed uses FTP (which is yet to be confirmed, as the author only thinks it does), I strongly doubt they used bare sockets for this and not some Windows library for handling the protocol.
Bookmarks