TCPClient/main.cpp

32 lines
739 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "login.h"
#include <QApplication>
#include <QDir>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Login w;
w.show();
QString document_name("Document");
QString record_name("ChatRecord");
QDir dir(QDir::currentPath());
QFile file("./ChatRecord/memory.txt");
if(!dir.exists(document_name))
{
dir.mkdir(document_name);
qDebug()<<QString("文件夹%1创建成功").arg(document_name);
}
if(!dir.exists(record_name))
{
dir.mkdir(record_name);
qDebug()<<QString("文件夹%1创建成功").arg(record_name);
}
if(!file.exists())
{
file.open(QIODevice::WriteOnly | QIODevice::Append);
}
return a.exec();
}