AstaRemote Documentation
Introduction
Installing Asta Remote
Adding Asta Remote to your server
Units:
AstaRemoteModel unit
Contains the basic components.
AstaRemotelib unit
Contains functions,objects and contents used by AstaRemoteModel, the demo and that you can
use on your Asta Remote based clients and servers.
Adding Asta Remote to your server
Adding Asta Remote to an existing server is very easy. Just follow these steps:
1) Add a TAstaRemSrv to your server's main form.
2) Set the AstaServerSocket property of TAstaRemSrv.
3) Add a TAstaRemMInfo to your server's main form.
4) Set the AstaRemSrv to AstaRemSrv1.
5) Compile! No, really! You already can run the included AstaRemoteCli or your own customized client, connect to your server and control it remotely.
Installing Asta Remote
1) Open astaremote.dpk on Delphi. Compile and Install it.
2) Add it to your library path.
Introduction
Asta Remote is an add-on to Asta in the form of a set of components that allow you to:
A) Support your Asta-based servers.
B) Support your user apps directly.
Some of the functions available right now are:
Information:
- Drive list (including label, size, space, format for every drive)
- General computer Information (COMPUTERNAME,WINDIR,SYSDIR,
SYSTIME,LOCALTIME,STZONE,DAYZONE,DAYZONESTDCHG,DAYZONEDAYCHG,USERNAME,OSVERSION)
- Memory Information.
- Getting/setting time on the server.
- Process list
Remote Control:
- Get screen (ZLIB compressed, variable bit depth)
- Remote Clicks and Double Clicks (demo for stretched screens on the EXE demo)
- Start Application (Filename, Directory, Parameters, Visibility. Returns status)
Files:
- Drive, Dir and file lists.
- Find Files, including content filter.
- File functions: Delete Dir, Delete File, Rename File/Directory, Copy File,
Create Directory.
- Transfer File from/to server (files are ZLIB compressed).
- Simple Sync (whole Dir synchronization, recursive, all in one paramlist,
mostly for testing and small files, but on small files it's very fast)
astaRemoteModel unit
Contains the components used in AstaRemote.
Components
TAstaRemMInfo
Exceptions
EAstaFileError
Types
TAstaDatasetEvent
TAstaModelInfoUpdate
TAstaParamEvent
TAstaScreenShotEvent
TAstaSyncEvent
EAstaFileError exception
See also
Unit
astaRemoteModel
Description
<<< Description of EAstaFileError exception >>>
See also
<<< See also of EAstaFileError exception >>>
TAstaRemMInfo component
See also Methods Events
Unit
astaRemoteModel
Description
<<< Description of TAstaRemMInfo component >>>
The basis of AstaRemote. Contains all the methods you need to communicate between the client and server. All you need to enable
your Asta Server for Asta Remote is place one copy of TAstaRemMInfo in your server and client and a copy of TAstaRemSrv and TAstaRemCli. Then add the interface you need on the client side.
See also
<<< See also of TAstaRemMInfo component >>>
Methods
Key methods
CopyFile
CreateDir
DeleteDir
DeleteFile
FindDirs
FindFiles
GetFileSync
GetProcessStringList
GetStringDirList
GetStringDriveList
PutFileSync
RenameFile
ChangeSysTime
Click
FindFilesAsync
GetDir
GetFile
GetScreenShot
SendDir
SyncSysTime
Update
Events
Key events
OnBasicSysInfo
OnDrives
OnError
OnFindFiles
OnGetFile
OnMemory
OnScreenShot
OnSync
CopyFile method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function CopyFile(OldName, Newname: string; overwrite: boolean): string;
Description
Copy file on server. Overwrites existing NewName files only if overwrite is true.Result is empty if Ok, else returns error
See also
<<< See also of CopyFile method >>>
CopyFile method example
CreateDir method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function CreateDir(path: string): string;
Description
Creates Directory at server.
See also
<<< See also of CreateDir method >>>
CreateDir method example
DeleteDir method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function DeleteDir(dir: string): string;
Description
Deletes directory and contents on server. Result is empty if Ok, else returns error
See also
<<< See also of DeleteDir method >>>
DeleteDir method example
DeleteFile method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function DeleteFile(filename: string): string;
Description
Deletes file on server. Result is empty if Ok, else returns error
See also
<<< See also of DeleteFile method >>>
DeleteFile method example
FindDirs method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function FindDirs(path: string; recursive, relative: boolean): TAstaDataset;
Description
Find Directories, returns TAstaDataset with directory data when done.
See also
<<< See also of FindDirs method >>>
FindDirs method example
FindFiles method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function FindFiles(path, mask, searchfor: string; recursive, relative, addDirs: boolean): TAstaDataset;
Description
Find Files, returns TAstaDataset with file data when done.
See also
<<< See also of FindFiles method >>>
FindFiles method example
GetFileSync method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function GetFileSync(filename: string): TMemoryStream;
Description
Gets files, returns when done.Exception if error
See also
<<< See also of GetFileSync method >>>
GetFileSync method example
GetProcessStringList method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function GetProcessStringList: TStringlist;
Description
a simple Stringlist, each string has the format Window text/Window Handle/ Class name. You can use AstaRemoteLib.SplitProcess for easy splitting.
See also
<<< See also of GetProcessStringList method >>>
GetProcessStringList method example
GetStringDirList method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function GetStringDirList(path: string): string;
Description
Return directories list (separated by CRLF)
See also
<<< See also of GetStringDirList method >>>
GetStringDirList method example
GetStringDriveList method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function GetStringDriveList: string;
Description
Return drive [LABEL] list (separated by CRLF)
See also
<<< See also of GetStringDriveList method >>>
GetStringDriveList method example
PutFileSync method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function PutFileSync(filename: string; s: TStream): string;
Description
Result empty if Ok, else returns error
See also
<<< See also of PutFileSync method >>>
PutFileSync method example
RenameFile method
See also Example
Applies to
TAstaRemMInfo component
Declaration
function RenameFile(OldName, Newname: string): string;
Description
Renames file on server. Result is empty if Ok, else returns error
See also
<<< See also of RenameFile method >>>
RenameFile method example
ChangeSysTime method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure ChangeSysTime(dt: TDatetime);
Description
<<< Description of ChangeSysTime method >>>
See also
<<< See also of ChangeSysTime method >>>
ChangeSysTime method example
Click method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure Click(x, y: integer; double: boolean);
Description
Click on the server at these coordinates
See also
<<< See also of Click method >>>
Click method example
FindFilesAsync method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure FindFilesAsync(path, mask, searchfor: string; recursive, relative, addDirs: boolean);
Description
Find Files, return immediatelly, result in OnFindFiles.
See also
<<< See also of FindFilesAsync method >>>
FindFilesAsync method example
GetDir method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure GetDir(path, destpath: string);
Description
Gets a whole directory from the server (Async), when the client
receives it, places it on destpath.
See also
<<< See also of GetDir method >>>
GetDir method example
GetFile method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure GetFile(filename: string);
Description
Gets a file on the server, Async. Returns file on OnGetFile.
See also
<<< See also of GetFile method >>>
GetFile method example
GetScreenShot method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure GetScreenShot(bits: integer = 24);
Description
Returns Screenshot from the server with Bits bit depth.
See also
<<< See also of GetScreenShot method >>>
GetScreenShot method example
SendDir method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure SendDir(path, destpath: string);
Description
Gets a whole directory on the client, when the server
receives it, it is placed on destpath.
See also
<<< See also of SendDir method >>>
SendDir method example
SyncSysTime method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure SyncSysTime;
Description
<<< Description of SyncSysTime method >>>
See also
<<< See also of SyncSysTime method >>>
SyncSysTime method example
Update method
See also Example
Applies to
TAstaRemMInfo component
Declaration
procedure Update(updateType: TAstaModelInfoUpdate);
Description
<<< Description of Update method >>>
See also
<<< See also of Update method >>>
Update method example
OnBasicSysInfo event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnBasicSysInfo: TAstaParamEvent;
Description
Receives basic system information.
See also
<<< See also of OnBasicSysInfo event >>>
OnBasicSysInfo event example
OnDrives event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnDrives: TAstaDatasetEvent;
Description
Receives Drive list
See also
<<< See also of OnDrives event >>>
OnDrives event example
OnError event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnError: TAstaServerSendStringsEvent;
Description
Generic Errors
See also
<<< See also of OnError event >>>
OnError event example
OnFindFiles event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnFindFiles: TAstaDatasetEvent;
Description
Receives a FileDataset from FindFilesAsync.
See also
<<< See also of OnFindFiles event >>>
OnFindFiles event example
OnGetFile event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnGetFile: TAstaParamEvent;
Description
Gets files as a TAstaParamlist. Param[0]=Filename, Param[1]=File, Param[2]=Either description of an exception or empty if ok.
See also
<<< See also of OnGetFile event >>>
OnGetFile event example
OnMemory event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnMemory: TAstaParamEvent;
Description
Gets memory information
See also
<<< See also of OnMemory event >>>
OnMemory event example
OnScreenShot event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnScreenShot: TAstaScreenShotEvent;
Description
Gets bitmap with screenshots.
See also
<<< See also of OnScreenShot event >>>
OnScreenShot event example
OnSync event
See also Example
Applies to
TAstaRemMInfo component
Declaration
property OnSync: TAstaSyncEvent;
Description
Generic Sync Event. See TAstaSyncEvent.
See also
<<< See also of OnSync event >>>
OnSync event example
TAstaDatasetEvent type
See also
Unit
astaRemoteModel
Declaration
type TAstaDatasetEvent = procedure(ads: TAstaDataset); of object;
Description
Event type for returning Datasets
See also
<<< See also of TAstaDatasetEvent type >>>
TAstaModelInfoUpdate type
See also
Unit
astaRemoteModel
Declaration
type TAstaModelInfoUpdate = (amiAll, amiDrives, amiMemory, amiGenInfo);
Description
used for Updates
See also
<<< See also of TAstaModelInfoUpdate type >>>
TAstaParamEvent type
See also
Unit
astaRemoteModel
Declaration
type TAstaParamEvent = procedure(p: TAstaParamList); of object;
Description
Event type for returning TAstaParamlists
See also
<<< See also of TAstaParamEvent type >>>
TAstaScreenShotEvent type
See also
Unit
astaRemoteModel
Declaration
type TAstaScreenShotEvent = procedure(bmp: TBitmap); of object;
Description
Event type for returning Bitmaps
See also
<<< See also of TAstaScreenShotEvent type >>>
TAstaSyncEvent type
See also
Unit
astaRemoteModel
Declaration
type TAstaSyncEvent = procedure(code: integer; msg, filename: string); of object;
Description
Event Type for returning data on file syncs. Code (undefined now), Msg has a short message about what happened to filename. Note: depending on the type of sync, may be called with several filenames or only when the synchronization is finished.
See also
<<< See also of TAstaSyncEvent type >>>
astaremotelib unit
See also
This unit contains a large number of functions and objects that are used by the Asta Remote components and the demo. They can also be used on your clients and servers.
Classes
TFileDs
Types
TOnFileCallBack
Routines
AddSlash
AstaDatasetToParamList
BitMapToParamList
BitsToPixelFormat
CopyAFile
CreateADir
DeleteADir
DeleteFilesInDir
FindDirsFast
GetDrives
GetExtIcon
GetFilesDS
GetMachineName
GetMemInfo
GetProcessList
GetSimpleDriveList
GetSysDir
GetSysInfo
GetSystime
GetTempDir
GetUser
GetWinDir
GoBack
ParamListToAstaDataset
ParamListToBitMap
ParamToAstaDataset
RelativePath
RenameAFile
ScreenShot
SetSystime
SplitProcess
StartApp
AstaDatasetToParam
ConvertBitMapDepth
PerformClick
PerformDoubleClick
WriteFileDs
Constants
arMClick
armCliPackTransfer
armCopyFile
armCreateDir
armDeleteDir
armDeleteFile
armDirList
armDoubleClick
armDriveList
armExecuteFile
arMFindFiles
armFindFilesAsync
arMFullScreenShot
armGetFile
armGetFileSync
arMInfo
arMInfoError
arMInfoGetSysTime
arMInfoSetSysTime
armProcessList
armPutFileSync
armRenameFile
armSimpleDirList
armSrvPackTransfer
asrError
CCommError
CCreateDirError
CDirNotFound
CDirWin32Error
CLongSysInfoTitle
CMega
CMissingDir
CRenameError
CRLF
MAX_SHORT_STRING
MILLISECONDS_TO_SECONDS
MIN_SHORT_STRING
SECONDS_TO_MILLISECONDS
See also
<<< See also of astaremotelib unit >>>
TFileDs class
See also Methods
Unit
astaremotelib
Description
Used to generate the filedatasets with file details for several methods of TAstaRemMInfo.
See also
<<< See also of TFileDs class >>>
Methods
Key methods
MakeFileDataset
MakeFileDataset method
See also Example
Applies to
TFileDs class
Declaration
function MakeFileDataset(path, mask, SearchFor: string; recursive, IncludeDirs, OnlyDirs, AddFiles, Relative: boolean): TAstaDataset;
Description
<<< Description of MakeFileDataset method >>>
See also
<<< See also of MakeFileDataset method >>>
MakeFileDataset method example
TOnFileCallBack type
See also
Unit
astaremotelib
Declaration
type TOnFileCallBack = procedure(path: string; f: tsearchrec); of Object;
Description
<<< Description of TOnFileCallBack type >>>
See also
<<< See also of TOnFileCallBack type >>>
AddSlash function
See also Example
Unit
astaremotelib
Declaration
function AddSlash(dir: string): string;
Description
<<< Description of AddSlash function >>>
See also
<<< See also of AddSlash function >>>
AddSlash function example
AstaDatasetToParamList function
See also Example
Unit
astaremotelib
Declaration
function AstaDatasetToParamList(ads: TAstaDataset): TAstaParamlist;
Description
<<< Description of AstaDatasetToParamList function >>>
See also
<<< See also of AstaDatasetToParamList function >>>
AstaDatasetToParamList function example
BitMapToParamList function
See also Example
Unit
astaremotelib
Declaration
function BitMapToParamList(bmp: TBitMap): TAstaParamList;
Description
<<< Description of BitMapToParamList function >>>
See also
<<< See also of BitMapToParamList function >>>
BitMapToParamList function example
BitsToPixelFormat function
See also Example
Unit
astaremotelib
Declaration
function BitsToPixelFormat(i: integer): TPixelFormat;
Description
<<< Description of BitsToPixelFormat function >>>
See also
<<< See also of BitsToPixelFormat function >>>
BitsToPixelFormat function example
CopyAFile function
See also Example
Unit
astaremotelib
Declaration
function CopyAFile(oldname, newname: string; overwrite: boolean): string;
Description
<<< Description of CopyAFile function >>>
See also
<<< See also of CopyAFile function >>>
CopyAFile function example
CreateADir function
See also Example
Unit
astaremotelib
Declaration
function CreateADir(path: string): string;
Description
<<< Description of CreateADir function >>>
See also
<<< See also of CreateADir function >>>
CreateADir function example
DeleteADir function
See also Example
Unit
astaremotelib
Declaration
function DeleteADir(adir: string): String;
Description
<<< Description of DeleteADir function >>>
See also
<<< See also of DeleteADir function >>>
DeleteADir function example
DeleteFilesInDir function
See also Example
Unit
astaremotelib
Declaration
function DeleteFilesInDir(directory: String): integer;
Description
<<< Description of DeleteFilesInDir function >>>
See also
<<< See also of DeleteFilesInDir function >>>
DeleteFilesInDir function example
FindDirsFast function
See also Example
Unit
astaremotelib
Declaration
function FindDirsFast(APath: string; recursive, relative: boolean): string;
Description
<<< Description of FindDirsFast function >>>
See also
<<< See also of FindDirsFast function >>>
FindDirsFast function example
GetDrives function
See also Example
Unit
astaremotelib
Declaration
function GetDrives: TAstaParamList;
Description
<<< Description of GetDrives function >>>
See also
<<< See also of GetDrives function >>>
GetDrives function example
GetExtIcon function
See also Example
Unit
astaremotelib
Declaration
function GetExtIcon(ext: string; small: boolean): TIcon;
Description
<<< Description of GetExtIcon function >>>
See also
<<< See also of GetExtIcon function >>>
GetExtIcon function example
GetFilesDS function
See also Example
Unit
astaremotelib
Declaration
function GetFilesDS: TAstaDataset;
Description
<<< Description of GetFilesDS function >>>
See also
<<< See also of GetFilesDS function >>>
GetFilesDS function example
GetMachineName function
See also Example
Unit
astaremotelib
Declaration
function GetMachineName: string;
Description
<<< Description of GetMachineName function >>>
See also
<<< See also of GetMachineName function >>>
GetMachineName function example
GetMemInfo function
See also Example
Unit
astaremotelib
Declaration
function GetMemInfo: TAstaParamList;
Description
<<< Description of GetMemInfo function >>>
See also
<<< See also of GetMemInfo function >>>
GetMemInfo function example
GetProcessList function
See also Example
Unit
astaremotelib
Declaration
function GetProcessList: TStringlist;
Description
<<< Description of GetProcessList function >>>
See also
<<< See also of GetProcessList function >>>
GetProcessList function example
GetSimpleDriveList function
See also Example
Unit
astaremotelib
Declaration
function GetSimpleDriveList: string;
Description
<<< Description of GetSimpleDriveList function >>>
See also
<<< See also of GetSimpleDriveList function >>>
GetSimpleDriveList function example
GetSysDir function
See also Example
Unit
astaremotelib
Declaration
function GetSysDir: string;
Description
<<< Description of GetSysDir function >>>
See also
<<< See also of GetSysDir function >>>
GetSysDir function example
GetSysInfo function
See also Example
Unit
astaremotelib
Declaration
function GetSysInfo: TAstaParamlist;
Description
<<< Description of GetSysInfo function >>>
See also
<<< See also of GetSysInfo function >>>
GetSysInfo function example
GetSystime function
See also Example
Unit
astaremotelib
Declaration
function GetSystime: TAstaParamList;
Description
<<< Description of GetSystime function >>>
See also
<<< See also of GetSystime function >>>
GetSystime function example
GetTempDir function
See also Example
Unit
astaremotelib
Declaration
function GetTempDir: string;
Description
<<< Description of GetTempDir function >>>
See also
<<< See also of GetTempDir function >>>
GetTempDir function example
GetUser function
See also Example
Unit
astaremotelib
Declaration
function GetUser: string;
Description
<<< Description of GetUser function >>>
See also
<<< See also of GetUser function >>>
GetUser function example
GetWinDir function
See also Example
Unit
astaremotelib
Declaration
function GetWinDir: string;
Description
<<< Description of GetWinDir function >>>
See also
<<< See also of GetWinDir function >>>
GetWinDir function example
GoBack function
See also Example
Unit
astaremotelib
Declaration
function GoBack(path: string): string;
Description
removes last dir from a path
See also
<<< See also of GoBack function >>>
GoBack function example
ParamListToAstaDataset function
See also Example
Unit
astaremotelib
Declaration
function ParamListToAstaDataset(p: TAstaParamlist): TAstaDataset;
Description
<<< Description of ParamListToAstaDataset function >>>
See also
<<< See also of ParamListToAstaDataset function >>>
ParamListToAstaDataset function example
ParamListToBitMap function
See also Example
Unit
astaremotelib
Declaration
function ParamListToBitMap(p: TAstaParamList): TBitMap;
Description
<<< Description of ParamListToBitMap function >>>
See also
<<< See also of ParamListToBitMap function >>>
ParamListToBitMap function example
ParamToAstaDataset function
See also Example
Unit
astaremotelib
Declaration
function ParamToAstaDataset(p: TAstaParamItem): TAstaDataset;
Description
<<< Description of ParamToAstaDataset function >>>
See also
<<< See also of ParamToAstaDataset function >>>
ParamToAstaDataset function example
RelativePath function
See also Example
Unit
astaremotelib
Declaration
function RelativePath(original, new: string): string;
Description
<<< Description of RelativePath function >>>
See also
<<< See also of RelativePath function >>>
RelativePath function example
RenameAFile function
See also Example
Unit
astaremotelib
Declaration
function RenameAFile(oldname, newname: string): string;
Description
Renames files or directories. NewName must not exist. Result is empty if ok, error otherwise.
See also
<<< See also of RenameAFile function >>>
RenameAFile function example
ScreenShot function
See also Example
Unit
astaremotelib
Declaration
function ScreenShot(x: integer; y: integer; Width: integer; Height: integer; fullscreen: boolean): TBitMap;
Description
<<< Description of ScreenShot function >>>
See also
<<< See also of ScreenShot function >>>
ScreenShot function example
SetSystime function
See also Example
Unit
astaremotelib
Declaration
function SetSystime(p: TAstaParamList): boolean;
Description
<<< Description of SetSystime function >>>
See also
<<< See also of SetSystime function >>>
SetSystime function example
SplitProcess function
See also Example
Unit
astaremotelib
Declaration
function SplitProcess(s: string; var wintext: string; var handle: integer; var classname: string): boolean;
Description
<<< Description of SplitProcess function >>>
See also
<<< See also of SplitProcess function >>>
SplitProcess function example
StartApp function
See also Example
Unit
astaremotelib
Declaration
function StartApp(filename, params, startingDir: string; visibility: integer): String;
Description
<<< Description of StartApp function >>>
See also
<<< See also of StartApp function >>>
StartApp function example
AstaDatasetToParam procedure
See also Example
Unit
astaremotelib
Declaration
procedure AstaDatasetToParam(ads: TAstaDataset; paramlist: TAstaParamlist);
Description
<<< Description of AstaDatasetToParam procedure >>>
See also
<<< See also of AstaDatasetToParam procedure >>>
AstaDatasetToParam procedure example
ConvertBitMapDepth procedure
See also Example
Unit
astaremotelib
Declaration
procedure ConvertBitMapDepth(var bmp: TBitmap; pixelFormat: TPixelFormat);
Description
<<< Description of ConvertBitMapDepth procedure >>>
See also
<<< See also of ConvertBitMapDepth procedure >>>
ConvertBitMapDepth procedure example
PerformClick procedure
See also Example
Unit
astaremotelib
Declaration
procedure PerformClick(x, y: integer);
Description
<<< Description of PerformClick procedure >>>
See also
<<< See also of PerformClick procedure >>>
PerformClick procedure example
PerformDoubleClick procedure
See also Example
Unit
astaremotelib
Declaration
procedure PerformDoubleClick(x, y: integer);
Description
<<< Description of PerformDoubleClick procedure >>>
See also
<<< See also of PerformDoubleClick procedure >>>
PerformDoubleClick procedure example
WriteFileDs procedure
See also Example
Unit
astaremotelib
Declaration
procedure WriteFileDs(ds: TAstaDataset; Apath: string; relative: boolean);
Description
Counterpart to TFileDS - writes a FileDataset. Used for Sync.
if the original dataset was created with Relative set, you *must* set
relative to true here.
generic
See also
<<< See also of WriteFileDs procedure >>>
WriteFileDs procedure example