那位用NetSharegetInfo成功过,帮帮忙。
我用NetSharegetInfo去服务器上共享文件夹在服务器上的绝对路径
就是读不出来,不只哪位能读出这个信息,帮帮忙,多谢了。
我的代码
type
TSHARE_INFO_502 = record
shi502_netname: PWideChar;
shi502_type: DWORD;
shi502_remark: PWideChar;
shi502_permissions: DWORD;
shi502_max_uses: DWORD;
shi502_current_uses: DWORD;
shi502_path: PWideChar;
shi502_passwd: PWideChar;
shi502_reserved: DWORD;
shi502_security_descriptor: PSECURITY_DESCRIPTOR;
End;
procedure TForm1.Button8Click(Sender: TObject);
var
a, b:PWideChar;
ShInfo: TSHARE_INFO_502;
lError: DWord;
begin
a := GetMemory(255);
b := GetMemory(255);
StringToWideChar('\\192.168.1.1', a, 255);
StringToWideChar('Record', b, 255);
lError := NetSharegetInfo(a, b, 502, @ShInfo);
if lError <> 0 then //此处能够执行成功,但是取不出来信息
;
Edit3.Text := WideCharToString(ShInfo.shi502_path);
FreeMem(a);
FreeMem(b);
end;