The interface "IShares" implements a collection of some specific
IShare objects. A list of methods and properties is contained in the
IShares Reference.
|
type IShares = interface (ICustomBasicList) ['{0E2E3601-4C3A-11D3-A52D-00005A180D69}'];
|
|
The function "Shares" lists all shares which have the specified properties:
|
type TShareType = (stDisk, stPrinter, stDevice, stIpc);
TShareTypeSet = set of TShareType;
function Shares (types : TShareTypeSet = [low(TShareType)..high(TShareType)];
path : string = '*';
serverName : string = '' ) : IShares;
with Shares([stPrinter] ) do ...
with Shares([stDisk ], WinFolder) do ...
|
|
The following properties return, what you gave in as parameters when
creating the "IShares" list:
|
property IShares.Types : TShareTypeSet;
property IShares.Path : string;
property IShares.ServerName : string;
|
|
The items of a "IShares" list are IShare objects. The method
"RefreshItems" looks for new/changed/deleted items, that have the specified
properties.
|
property IShares.Items [index: integer] : IShare;
function IShares.RefreshItems : boolean;
|
|
The following method deletes all listed shares at once:
|
function IShares.Delete : boolean;
Shares.Delete;
|
|
The interface "IShare" implements everything you need when dealing with a
single share. A list of functions and properties can be found in the
IShare Reference.
|
type IShare = interface (IBasic) ['{0E2E3600-4C3A-11D3-A52D-00005A180D69}'];
|
|
You can either get an "IShare" instance for an existing share or you can
create a totally new share with the specified attributes. The attributes
"access", "password", "rwPassword", "persist", "system" and "maxUses" are
not always available.
|
type TShareAccess = (aRead, aWrite, aCreate, aExec, aDelete, aAtrib, aPerm, aFindFirst);
TShareAccessSet = set of TShareAccess;
function Share (netName : string;
serverName : string = '' ) : IShare;
function NewShare (path : string;
netName : string;
------------- remark : string = '';
- access : TShareAccessSet = [low(TShareAccess)..high(TShareAccess)];
- password : string = '';
-. + rwPassword : string = '';
persist : boolean = true;
system : boolean = false;
maxUses : integer = -1;
serverName : string = '' ) : IShare;
|
|
The following properties are valid for every share on every OS. They can't
be changed. The property "ServerName" returns on which server this share is
installed.
|
property IShare.Type_ : TShareType;
property IShare.ServerName : string;
|
|
The following properties are valid for every share on every OS. You can ask
and also change them. However, changing the path or the netname of a share
results in that the share internally gets deleted and recreated. In win9x
the netname is limited to 12 characters.
|
property IShare.Path : string;
property IShare.NetName : string;
property IShare.Remark : string;
|
|
The following properties are only valid, when the server is running with
share-level security. The ReadWritePassword furthermore is only valid in
win9x.
|
property IShare.Access : TShareAccessSet;
property IShare.Password : string;
property IShare.ReadWritePassword : string;
|
|
The following properties are only valid in win9x. "Persist" determines,
whether the share will survive system reboot. "System" determines, whether
the share is visible in the Explorer.
|
property IShare.Persist : boolean;
property IShare.System : boolean;
|
|
The following properties are only valid in winNT. "CurrentUses" returns, how
often the share is currently used. "MaxUses" determines how often the share
may be used at the same time.
|
property IShare.CurrentUses : integer;
property IShare.MaxUses : integer;
|
|
The property "Refresh" reloads all share properties.
|
function IShare.Refresh : boolean;
|
|
The method "IsDirty" tells you whether there were changes in the current
share, that are not flushed yet. The method "Flush" realizes all changes.
|
function IShare.IsDirty : boolean;
function IShare.Flush : boolean;
|
|
The following methods/properties deal with the security aspects of the
current share. You can work with the ISecurityObject of the share or
directly with the IAcl of the share.
There's one thing you should know: In winNT each disk share has it's own
security. Plus the share's target (e.g. a directory) has also it's own
security. The security of the share's target has no effect on the share.
In contrast printer shares in winNT and also every kind of shares in win9x
have NO own security. Instead they use the security of the share's target.
The "SecurityObject" method returns the ISecurityObject that really
matters, that is the share's security object for winNT disk shares and the
target's security object for winNT printer shares and for all win9x
shares. The "Acl" property also gives access to the right IAcl object,
of course.
The following method deletes the current share.
|
function IShare.Delete : boolean;
Share('WinFolder').Delete;
|
|
The procedure "ClearShareName" shorts "str" (if necessary) in the way so that
"str" contains a valid share netname.
|
procedure ClearShareName (var str: string);
ClearShareName( 'Dämlich, Gunfried' ) -> 'DÄMLICH· GUN'
ClearShareName('\\server\Dämlich, Gunfried\test.exe') -> '\\server\DÄMLICH· GUN\test.exe'
|
|