http://pbdc.cafe24.com 박상희님 글 발췌
Structure Name : netresource
Structure Member
Long dwscope
Long dwtype
Long dwdisplay
Long dwusage
String lplocalname
String lpremortename
String lpcomment
String lpprovider
External Function :
Function Long WNetAddConnection2(Ref netresource lpnetresource, string lpszPassword ,string lpusername, long dwflags ) Library "mpr.dll" Alias For "WNetAddConnection2A"
------------------------------------------------------
Function Name : of_netadd
Arguments : String as_userid
: String as_password
: String as_remote
: String as_local
RETURN : -
------------------------------------------------------
String ls_netname
String ls_drive
String ls_username
String ls_passwd
Long ll_rtn
NETRESOURCE lpNetResource
ls_username = as_userid
ls_passwd = as_passwd
ls_netname = as_remote
ls_drive = as_local
lpNetResource.lpRemorteName = ls_netname
lpNetResource.lpLocalName = ls_drive
ll_rtn = WNetAddConnection2(lpNetResource,ls_passwd,ls_username,1)
IF ll_rtn <> 0 THEN
RETURN -1
END IF
RETURN 1
Structure Name : netresource
Structure Member
Long dwscope
Long dwtype
Long dwdisplay
Long dwusage
String lplocalname
String lpremortename
String lpcomment
String lpprovider
External Function :
Function Long WNetAddConnection2(Ref netresource lpnetresource, string lpszPassword ,string lpusername, long dwflags ) Library "mpr.dll" Alias For "WNetAddConnection2A"
------------------------------------------------------
Function Name : of_netadd
Arguments : String as_userid
: String as_password
: String as_remote
: String as_local
RETURN : -
------------------------------------------------------
String ls_netname
String ls_drive
String ls_username
String ls_passwd
Long ll_rtn
NETRESOURCE lpNetResource
ls_username = as_userid
ls_passwd = as_passwd
ls_netname = as_remote
ls_drive = as_local
lpNetResource.lpRemorteName = ls_netname
lpNetResource.lpLocalName = ls_drive
ll_rtn = WNetAddConnection2(lpNetResource,ls_passwd,ls_username,1)
IF ll_rtn <> 0 THEN
RETURN -1
END IF
RETURN 1