Use Membership API in WinForms Application

Discussion in 'ASP .Net Security' started by Graham, Feb 7, 2006.

  1. Graham

    Graham Guest

    Hi All

    I'm developing an ASP.NET 2.0 application that uses the new membership
    features, however I also need to develop a WinForms application that manages
    users when they have registered. This management revolves around linking
    users to internal business data, however I would also like to build-in the
    ability to manage users using the membership API directly in my WinForms
    app. I can do this through code in the ASP.NET application, where the
    provider information is supplied from web.config. In my WinForms application
    this isn't available of course, and I presumably need to supply the provider
    info via code. Any ideas how to do this?

    Thanks!

    Cheers - Graham
    Graham, Feb 7, 2006
    #1
    1. Advertising

  2. Hi,

    you can use the provider also in WinForms - use app.config instead.

    Reference system.web.dll and copy the relevant entries from your web.config
    to the app.config file.

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > Hi All
    >
    > I'm developing an ASP.NET 2.0 application that uses the new membership
    > features, however I also need to develop a WinForms application that
    > manages users when they have registered. This management revolves
    > around linking users to internal business data, however I would also
    > like to build-in the ability to manage users using the membership API
    > directly in my WinForms app. I can do this through code in the ASP.NET
    > application, where the provider information is supplied from
    > web.config. In my WinForms application this isn't available of course,
    > and I presumably need to supply the provider info via code. Any ideas
    > how to do this?
    >
    > Thanks!
    >
    > Cheers - Graham
    >
    Dominick Baier [DevelopMentor], Feb 7, 2006
    #2
    1. Advertising

  3. Graham

    Graham Guest

    Hi Dominick

    Thanks for your suggestion - it works a treat! Just out of interest, is it
    possible to configure the provider through code? Presumably this is what is
    happening behind the scenes?

    Cheers - Graham

    "Dominick Baier [DevelopMentor]" <>
    wrote in message news:...
    > Hi,
    > you can use the provider also in WinForms - use app.config instead.
    >
    > Reference system.web.dll and copy the relevant entries from your
    > web.config to the app.config file.
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    >> Hi All
    >>
    >> I'm developing an ASP.NET 2.0 application that uses the new membership
    >> features, however I also need to develop a WinForms application that
    >> manages users when they have registered. This management revolves
    >> around linking users to internal business data, however I would also
    >> like to build-in the ability to manage users using the membership API
    >> directly in my WinForms app. I can do this through code in the ASP.NET
    >> application, where the provider information is supplied from
    >> web.config. In my WinForms application this isn't available of course,
    >> and I presumably need to supply the provider info via code. Any ideas
    >> how to do this?
    >>
    >> Thanks!
    >>
    >> Cheers - Graham
    >>

    >
    >
    Graham, Feb 8, 2006
    #3
  4. The provider can not be configured in code, it has to been in .config file.

    Regards,

    Luke Zhang
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Luke Zhang [MSFT], Feb 9, 2006
    #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. Arun Kumar

    Printing in WinForms Using c#

    Arun Kumar, Oct 7, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,117
    Dino Chiesa [Microsoft]
    Oct 9, 2003
  2. CV
    Replies:
    1
    Views:
    3,802
    Christian Kuendig
    Mar 6, 2004
  3. Replies:
    0
    Views:
    553
  4. John123

    Profiling API or Membership API

    John123, Oct 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    371
    John123
    Oct 20, 2006
  5. Tino Donderwinkel
    Replies:
    2
    Views:
    756
    Tino Donderwinkel
    Jun 18, 2008
Loading...

Share This Page