Re: How to obtain current credentials?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • K Viltersten

    Re: How to obtain current credentials?

    try this:
    Imports System.Security .Principal
    >
    Public Function currentId() As String
    Dim strReturn As String
    >
    strReturn = WindowsIdentity .GetCurrent().N ame()
    >
    'strReturn = User.Identity.N ame
    >
    Return strReturn
    >
    End Function
    How would you express the same hint in C#?

    Regards
    Konrad Viltersten


  • Paul E Collins

    #2
    Re: How to obtain current credentials?

    "K Viltersten" <tmp1@vilterste n.comwrote:
    How would you express the same hint in C#?
    using System.Security .Principal;

    // ...then, within a class...

    public string CurrentId()
    {
    return WindowsIdentity .GetCurrent().N ame;
    }

    Eq.


    Comment

    • K Viltersten

      #3
      Re: How to obtain current credentials?

      >How would you express the same hint in C#?
      >
      using System.Security .Principal;
      >
      // ...then, within a class...
      >
      public string CurrentId()
      {
      return WindowsIdentity .GetCurrent().N ame;
      }
      Thanks. I should have thought of it myself... :)

      Regards
      Konrad Viltersten


      Comment

      Working...