Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2001, 01:16 AM
N/A
Guest
 
Posts: n/a
Default FTP - Server without Forms

How to program a ftp - server without
forms. The program size must be very
low (not over 70 kb).
Reply With Quote
  #2  
Old 01-02-2001, 05:55 AM
N/A
Guest
 
Posts: n/a
Default RE: FTP - Server without Forms

Happy New Year ... )

Create a Console application.

Be sure that you define only neccessary functions and types in your program to decrease the size.


Regards

/Filip
Reply With Quote
  #3  
Old 01-02-2001, 08:57 AM
N/A
Guest
 
Posts: n/a
Default RE: RE: FTP - Server without Forms

Can you give my an example, please?
Reply With Quote
  #4  
Old 01-02-2001, 11:45 PM
PoseFant PoseFant is offline
Senior Member
 
Join Date: Jan 2001
Posts: 1,002
Default Console Application

I don't have any FTP examples, but when you create a new project, create a console application, it should be an option.

Or

Program Blablabla;

{$APPTYPE CONSOLE}

You may also use CreateProcess with several Console API calls, but this method is some difficult, but great reading.
Check out the SDK help files ...

Off and on topic again ... )

Then ... Every time you use a Types or Functions, check where they are defined.

Example :

Uses SysUtils,Windows, WinSvc, SvcMgr;

This gives you a lot of predefined Types and Functions, but you don't need them all ... )

So ... let's say that you only need the DWord Type from Windows.dcu

Example

Uses SysUtils;

Type
DWord = LongWord;

We have now cut of the windows.dcu and having only the needed line for our Type

Ok ...

LongWord is predefined in the compiler so we can't do anything with it ... )

Also ... there's a lot of Constants in different dcus ... cut them out ...

Example

Uses SysUtils;

Const
SERVICE_WIN32 = ($00000010 Or $00000020);

Prevents you from having the winsvc.dcu, if you only need the SERVICE_WIN32 Constant.

What about Functions ...

Example :

Uses
SysUtils;

Type
lpCTSTr = PAnsiChar;
DWord = LongWord;
PDWord = ^DWord;
SC_HANDLE = LongInt;

Const
ServiceFile = 'advapi32.dll';

Function OpenSCManager(lpMachinename : lpCTStr; lpDataBaseName : lpCTStr; dwDesiredAccess : DWord) : SC_HANDLE; StdCall; External ServiceFile Name
'OpenSCManagerW';

Function CreateService(hSCManager : SC_HANDLE; lpServiceName : lpCTStr; lpDisplayName : lpCTStr; dwDesiredAccess : DWord; dwServiceTye : DWord; dwStartType : DWord; dwErrorControl : DWord; lpBinaryPathName : lpCTStr; lpLoadOrderGroup : lpCTStr; lpdwTagId : PDWord; lpDependencies : lpCTStr; lpServiceStartName : lpCTStr; lpPassWord : lpCTStr) : SC_HANDLE; StdCall; External ServiceFile Name
'CreateServiceW';


As you can see ... There is a bit of work, but afterall ... it's worth it ... )


Good Luck ...

Regards


/Filip
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 05:53 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.