C
carem1
Unregistered / Unconfirmed
GUEST, unregistred user!
为什么我不可以按照sharenumber循环地删除所有共享??<br>function NetShareDel(ServerName: Widestring; NetName: Widestring;<br> Reserved: DWord): Integer; stdcall; external 'netapi32.dll' name<br> 'NetShareDel';<br>.............................<br>...........................<br>var<br> netname: array[0..255] of WideChar;<br> ServerName: widestring;<br> sharpnumber:integer;<br>begin<br> if strcmd = 'aaa'then //取消所有已经共享的磁盘或者目录<br> begin<br> ServerName := '';<br> begin<br> for sharpnumber := sharpnumber to -1 do<br> StringToWideChar('监控共享' + IntToStr(sharpnumber), netname, 255);<br> NetShareDel(ServerName, netname, 0);<br> end;<br> sharpnumber := sharpnumber - 1; <br> end;<br>end;