네트워크 드라이브 마운트하기
기본적으로 WNetAddConnection2 를 사용하면 됨 인증관련 창이 뜰때 내 윈도우 핸들을 넘기고 싶으면 WNetAddConnection3 를 사용 주의점으로 WNet API를 호출하는 어플리케이션은 user logon에 대해서만 적용을 받기 때문에, 전역적으로 영향을 주려면 아래와 같이 해야 한다. If a service that runs as LocalSystem calls the WNetAddConnect2 fuction, then the mapped drive is visible to all user logon sessions. 예제) NETRESOURCE nr; memset(&nr, 0, sizeof(NETRESOURCE); nr.dwType = RESOURCETYPE_ANY; nr.lpRemoteName = m_csRemote; nr.lpProvider = NULL; dwRetVal = WNetAddConnection2(&nr, m_csUserName, m_csPassword, dwFlags); if( dwRetVal == NO_ERROR ) success else fail username 입력, password 미입력시 67리턴(ERROR_BAD_NET_NAME) asd