Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > .Net roles in a Windows App

Reply
Thread Tools

.Net roles in a Windows App

 
 
Gerhard
Guest
Posts: n/a
 
      02-16-2007
Hi,

I have a Windows Application that I am successfully using
Membership.ValidateUser to validate a user against the same database I use
for the Web App part of the system. My question is, how do I use the role
based security similiar to IsInRole function that is available in a Web App
through HttpContext.Current.User in my Windows Application?

Thanks.

 
Reply With Quote
 
 
 
 
Luke Zhang [MSFT]
Guest
Posts: n/a
 
      02-19-2007
Hi,

You may create your customized User class by implementing IPrincipal to
instead of HttpContext.Current.User, and 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.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



 
Reply With Quote
 
 
 
 
Gerhard
Guest
Posts: n/a
 
      02-19-2007
Thanks. Is there any sample code to show how to implement IPrincipal in
VB.Net in this way?

"Luke Zhang [MSFT]" wrote:

> Hi,
>
> You may create your customized User class by implementing IPrincipal to
> instead of HttpContext.Current.User, and 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.
>
> Sincerely,
>
> Luke Zhang
>
> Microsoft Online Community Support
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>

 
Reply With Quote
 
Luke Zhang [MSFT]
Guest
Posts: n/a
 
      02-20-2007
Hello,

I didn't find a exactly matched example, but you may take a look at this
one:

http://msdn2.microsoft.com/en-us/library/aa302401.aspx

Even it is for web application, you can still use some code and idea in it.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



 
Reply With Quote
 
Gerhard
Guest
Posts: n/a
 
      02-20-2007
Thanks. That handled it for me.

Have a happy day.

"Luke Zhang [MSFT]" wrote:

> Hello,
>
> I didn't find a exactly matched example, but you may take a look at this
> one:
>
> http://msdn2.microsoft.com/en-us/library/aa302401.aspx
>
> Even it is for web application, you can still use some code and idea in it.
>
> Sincerely,
>
> Luke Zhang
>
> Microsoft Online Community Support
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the easiest way to convert a .net windows app to web app? tom ASP .Net 4 10-24-2008 05:57 PM
Integrating Legacy Windows app with ASP.Net app John Stockton ASP .Net 2 10-12-2005 04:17 PM
Application level roles + Item level roles... how to do it? Jéjé ASP .Net Security 0 09-26-2005 11:06 PM
debug Windows app works but, not web app =?Utf-8?B?R2lhbmNhcmxv?= ASP .Net 0 09-26-2005 06:16 PM
Can connect to SQLServer from windows app, not from web app jhcorey@yahoo.com ASP .Net 1 08-02-2005 01:27 PM



Advertisments