Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Access to other computer. How to?

Access to other computer. How to?

Scheduled Pinned Locked Moved C / C++ / MFC
jsontutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thangnvhl
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • T thangnvhl

      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

      M Offline
      M Offline
      Milton Karimbekallil
      wrote on last edited by
      #2

      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 call ImpersonateLoggedOnUser 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

      T 3 Replies Last reply
      0
      • M Milton Karimbekallil

        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 call ImpersonateLoggedOnUser 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

        T Offline
        T Offline
        thangnvhl
        wrote on last edited by
        #3

        It's really worked. Thank you so much

        Sincerely Thangnvhl

        1 Reply Last reply
        0
        • M Milton Karimbekallil

          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 call ImpersonateLoggedOnUser 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

          T Offline
          T Offline
          thangnvhl
          wrote on last edited by
          #4

          I 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

          1 Reply Last reply
          0
          • M Milton Karimbekallil

            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 call ImpersonateLoggedOnUser 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

            T Offline
            T Offline
            thangnvhl
            wrote on last edited by
            #5

            I 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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups