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#
  4. How to find the current user domain

How to find the current user domain

Scheduled Pinned Locked Moved C#
helptutorial
2 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.
  • N Offline
    N Offline
    NK7
    wrote on last edited by
    #1

    Hi Can any one help me to find the current user domain. I am using the follwing code: WindowsIdentity wIdentity= WindowsIdentity.GetCurrent(); Its listing only the current system connected domain. For ex: I belongs to domain retail, if i log in using my userid and domain("retail") from other machine belongs to other domain, its giving that system domain instead of my domain. Help me please. kesavan

    O 1 Reply Last reply
    0
    • N NK7

      Hi Can any one help me to find the current user domain. I am using the follwing code: WindowsIdentity wIdentity= WindowsIdentity.GetCurrent(); Its listing only the current system connected domain. For ex: I belongs to domain retail, if i log in using my userid and domain("retail") from other machine belongs to other domain, its giving that system domain instead of my domain. Help me please. kesavan

      O Offline
      O Offline
      originSH
      wrote on last edited by
      #2

      What is this for? ASP.Net or something else? FOr ASP.Net the code you have there is correct, if it's giving you the wrong results then you probably don't have impersonation setup correctly. If it's for something else then check out the System.Environment[^] class.

      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