在98下你要自己声明啊
Function NetShareAdd(servername
Char; level:SmallInt;buf
ointer;
buf_len:SmallInt):SmallInt;far;stdcall;external 'svrapi.dll';
Function NetShareDel(servername
Char;buf
ointer; reserved:SmallInt):
SmallInt;far;stdcall;external 'svrapi.dll';
我用过没问题啊,有问题再与我联络
可能还会用到如下:
const
NETNAME_LEN = 13;PASSWORD_LEN = 9;SHI50F_RDONLY = $0001;
SHI50F_FULL = $0002;SHI50F_DEPENDSON = $0003;
SHI50F_ACCESSMASK = $0003;SHI50F_PERSIST = $0100;
SHI50F_SYSTEM = $0200;STYPE_DISKTREE = 0;
STYPE_PRINTQ = 1;STYPE_DEVICE = 2;
STYPE_IPC = 3;NERR_Success = 0;
NERR_BASE = 2100; //常量说明
NERR_UnKnownDevDir=(NERR_BASE+16);NERR_UnknownServer=(NERR_BASE+3);
NERR_ServerNotStarted=(NERR_BASE+14);NERR_RedirectedPath=(NERR_BASE+17);
NERR_DuplicateShare=(NERR_BASE+18);NERR_BufTooSmalll=(NERR_BASE+23); //NetShareAdd返回错误
NERR_NetNotStarted = (NERR_BASE+2);
NERR_NetNameNotFound = (NERR_BASE+210);
NERR_ShareNotFound = (NERR_BASE+292); //NetShareDel返回错误
RSP_SIMPLE_SERVICE = 1; //用未公开函数RegisterServiceProcess
RSP_UNREGISTER_SERVICE = 0;
type
SHARE_INFO_50 = Record
netname:array [0..NETNAME_LEN-1] of Char;
sharetype:ShortInt;
flags:SmallInt;
remark
Char;
path
Char;
rw_password:array [0..PASSWORD_LEN-1] of Char;
ro_password:array [0..PASSWORD_LEN-1] of Char;
end;