test.cpp

来自「自己写的选课系统,命令行下的...比较简陋...」· C++ 代码 · 共 78 行

CPP
78
字号
#include <iostream>
#include <conio.h>
#include "String.h"
#include "Database.h"
#include "Recordset.h"
#include "Time.h"
#include "Grid.h"
#include "Table.h"
#include "myIO.h"
#include "Entrance.h"

using namespace std;


myIO io;
static String Opening[] = {
"                                                                     ",
"      l                  l                               h           ",
"      l                  l                               h           ",
"     l                  l                                h           ",
"     l                  l                                h           ", 
"     l                  l                                h           ", 
"     l                  l                               h            ",
"    l         eeee     l       oooo    u  u     ccc     h            ",
"    l        e   e     l      o    o   u  u    c   c    h            ",   
"    l       e  ee      l     o     o   u  u    c   c    hhhh         ",
"    l      e ee        l     o     o  u  u    c         h   h        ",  
"    l      ee          l     o     o  u  u    c         h   h        ",
"    l      e    e      l  l   o   o   u  u    c   c     h    h  h    ",      
"    llllll  eeee       lll     ooo    uuuu     ccc      h     hh     ",     
"                                                                     "
};
//初始界面工作....
void Init()
{
	cout << endl << endl;
	io << "welcome";
	cout << endl << endl;
}

//退出界面工作....
void Quit()
{
	cout << endl << endl;
	io << "Bye";
	cout << endl << endl;
}



int main()
{
	String dsn, user, pass;
	Database db;
	for (int i = 0; i < sizeof (Opening) / sizeof (Opening[0]); i++)
		cout << Opening[i] << endl;
	while (true)
	{
		io << "dsn:";
		io >> dsn;
		io << "user";
		io >> user;
		io << "password";
		pass = io.getIn();
		if (db.Open(dsn, user, pass))
		{	
			Init();
			IntoEntrance(db);
			break;
		}
		else
			io << "unavailable connection, input again...";
	}
	Quit();

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?