Access to other computer. How to?
-
Dear, I am trying to write a program that can access to other computer in my LAN with a specified user name and password. Please show me how to do this. I am working with C API. Thank you very much.
Sincerely Thangnvhl
Hope what u need is to access the file system on the remote computer. For this u have to impersonate the user context of ur application to a user who has acceess on the remote machine. So by using the username and password u have, call
LogonUser
API. Then callImpersonateLoggedOnUser
by passing the tocken u received as out from LogonUser. Once impersonataed, eitehr u can use the unc path to access the remote file system, or if it not shared u can use the default NT share c$, d$ etc for each drive. cheers Milton KB -
Hope what u need is to access the file system on the remote computer. For this u have to impersonate the user context of ur application to a user who has acceess on the remote machine. So by using the username and password u have, call
LogonUser
API. Then callImpersonateLoggedOnUser
by passing the tocken u received as out from LogonUser. Once impersonataed, eitehr u can use the unc path to access the remote file system, or if it not shared u can use the default NT share c$, d$ etc for each drive. cheers Milton KB -
Hope what u need is to access the file system on the remote computer. For this u have to impersonate the user context of ur application to a user who has acceess on the remote machine. So by using the username and password u have, call
LogonUser
API. Then callImpersonateLoggedOnUser
by passing the tocken u received as out from LogonUser. Once impersonataed, eitehr u can use the unc path to access the remote file system, or if it not shared u can use the default NT share c$, d$ etc for each drive. cheers Milton KBI am verry sorry. I try to create one program and it really worked at only my computer with current user. I could not connect to other computers, even my localhost with other accounts. LogonUser always returned FALSE. Please could you give me some code. Needn't API, non MFCs are OK.
Sincerely Thangnvhl
-
Hope what u need is to access the file system on the remote computer. For this u have to impersonate the user context of ur application to a user who has acceess on the remote machine. So by using the username and password u have, call
LogonUser
API. Then callImpersonateLoggedOnUser
by passing the tocken u received as out from LogonUser. Once impersonataed, eitehr u can use the unc path to access the remote file system, or if it not shared u can use the default NT share c$, d$ etc for each drive. cheers Milton KBI am verry sorry. I try to create one program and it really worked at only my computer with current user. I could not connect to other computers, even my localhost with other accounts. LogonUser always returned FALSE. Please could you give me some code. Needn't API, non MFCs are OK. Thank you very much.
Sincerely Thangnvhl