Добавил:
Upload
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:seti_2semestr / Лабораторные работы / ЛР_7 / Samples / TCP / VisualCPP / TCPClient / TCPClient
.cpp// TCPClient.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "TCPClient.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#include <conio.h>
#include "FTPClient.h"
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
if(!::AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else if(!::AfxSocketInit())
{
_tprintf(_T("Fatal Error: Socket initialization failed\n"));
nRetCode = 2;
}
else
{
CFTPClient Client;
if(Client.ConnectServer("ftp.lipetsk.ru","anonymous","alexeev@lipetsk.ru"))
{
Client.ChangeDirectory("/");
Client.ListDirectory();
Client.RetrieveFile("README","d:\readme");
Client.DisconnectServer();
}
getch();
}
return nRetCode;
}
Соседние файлы в папке TCPClient