Accessing current user in Managed C++ Web Service?

Discussion in 'ASP .Net Web Services' started by Sharon McCarty, Nov 1, 2004.

  1. Hi Everyone,

    I created a managed c++ web service and I would like to access the
    current user. For instance, in a C# web service, you would normally
    type in: HttpContext.Current.User.Identity.Name;

    to get the user name. Can someone tell me how I would achieve this in
    managed c++ web service?

    Thanks

    Sharon
    Sharon McCarty, Nov 1, 2004
    #1
    1. Advertising

  2. Hi,

    This should work:

    HttpContext::Current->User->Identity->Name

    Dilton

    "Sharon McCarty" <> wrote in message
    news:...
    > Hi Everyone,
    >
    > I created a managed c++ web service and I would like to access the
    > current user. For instance, in a C# web service, you would normally
    > type in: HttpContext.Current.User.Identity.Name;
    >
    > to get the user name. Can someone tell me how I would achieve this in
    > managed c++ web service?
    >
    > Thanks
    >
    > Sharon
    DM McGowan II, Nov 2, 2004
    #2
    1. Advertising

  3. PS Sharon,

    Unless you just love the challenge of mangled (I mean Managed) C++; I'd
    heartily recommend using C# for your Web Service, and if you must access
    some native code, then create a thin managed layer that can "talk" both
    C/C++ and C#.

    Dilton

    "DM McGowan II" <> wrote in message
    news:...
    > Hi,
    >
    > This should work:
    >
    > HttpContext::Current->User->Identity->Name
    >
    > Dilton
    >
    > "Sharon McCarty" <> wrote in message
    > news:...
    >> Hi Everyone,
    >>
    >> I created a managed c++ web service and I would like to access the
    >> current user. For instance, in a C# web service, you would normally
    >> type in: HttpContext.Current.User.Identity.Name;
    >>
    >> to get the user name. Can someone tell me how I would achieve this in
    >> managed c++ web service?
    >>
    >> Thanks
    >>
    >> Sharon

    >
    DM McGowan II, Nov 6, 2004
    #3
  4. Thanks Guys for both your input!

    Sharon

    "DM McGowan II" <> wrote in message news:<>...
    > PS Sharon,
    >
    > Unless you just love the challenge of mangled (I mean Managed) C++; I'd
    > heartily recommend using C# for your Web Service, and if you must access
    > some native code, then create a thin managed layer that can "talk" both
    > C/C++ and C#.
    >
    > Dilton
    >
    > "DM McGowan II" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > This should work:
    > >
    > > HttpContext::Current->User->Identity->Name
    > >
    > > Dilton
    > >
    > > "Sharon McCarty" <> wrote in message
    > > news:...
    > >> Hi Everyone,
    > >>
    > >> I created a managed c++ web service and I would like to access the
    > >> current user. For instance, in a C# web service, you would normally
    > >> type in: HttpContext.Current.User.Identity.Name;
    > >>
    > >> to get the user name. Can someone tell me how I would achieve this in
    > >> managed c++ web service?
    > >>
    > >> Thanks
    > >>
    > >> Sharon

    > >
    Sharon McCarty, Nov 9, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sharon McCarty
    Replies:
    0
    Views:
    340
    Sharon McCarty
    Nov 1, 2004
  2. Jorge Loureriro
    Replies:
    2
    Views:
    266
    Rolf Tollerud
    Feb 11, 2004
  3. Ray Deese

    Managed C++ Web Service - strange reflection problems

    Ray Deese, May 6, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    122
    Ray Deese
    May 6, 2004
  4. rgarf

    Managed C++ Web Service

    rgarf, Apr 6, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    112
    rgarf
    Apr 6, 2006
  5. Matthew Kane

    Issues with assemblies referenced by a managed C++ web service

    Matthew Kane, May 15, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    160
    Steven Cheng[MSFT]
    May 16, 2006
Loading...

Share This Page