如何使用qfile或fstream在QT创建者中打开文本文件
QFile file("D:/QT/employee manager ui/EmployeeManager/employeeLogIn.txt");
if(!file.open(QIODevice::ReadOnly))
{
QMessageBox::information(0, "info", file.errorString());
}
我尝试使用fstream,然后ifstream在QT创建者中打开文件,但无法打开文件。指定文件位置时,我同时使用了后斜线和双向斜杠。昨晚,我的代码运行,但没有打开文件。
该项目具有Qmake Build System和QT Widget应用程序,
谢谢!
QFile file("D:/QT/employee manager ui/EmployeeManager/employeeLogIn.txt");
if(!file.open(QIODevice::ReadOnly))
{
QMessageBox::information(0, "info", file.errorString());
}
I tried to use fstream, and ifstream to open the the file in QT creator, but I could not open the file. I used both back slash and double forward slash while specifying the file location. Last night, my code ran, but doesn't open the file.
This project has qmake build system, and QT widget application
thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论