묻고 답하기 › LAN에서 서버를 드라이브 Mapping

이천주 1999.05.24 20:04:08
장수하세요.



윈도우 API함수중에 WNetAddConnection2를 이용하면

네트워크(LAN)에서 서버를 드라이브 Mapping할 수 있다고 합니다.

델파이에서는 어떻게 하는지요?



NETRESOURCE라는 스트럭쳐를 선언하고 하는 방법이 어떻게 되는지요?



<참고로, 아래는 C++의 소스입니다.>

#include

#include



void main(void)

{

NETRESOURCE netrc;



netrc.dwScope = RESOURCE_GLOBALNET ;

netrc.dwType = RESOURCETYPE_DISK;

netrc.dwDisplayType = RESOURCEDISPLAYTYPE_GENERIC;

netrc.lpLocalName = "F:";

netrc.lpRemoteName = "\Appswsys";

netrc.lpProvider = NULL;



UINT ret = ::WNetAddConnection2(&netrc, "XYZ123", "XYZ123", CONNECT_UPDATE_PROFILE);

if (NO_ERROR == ret)

{

printf("Connection Success !!!n");

}

else

{

printf("Connection Failed !!!n");

}

}

}





댓글 [2]

Cancel