473,382 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Check for the Admin User (C#) !!!

Atran
319 100+
Hello:
I build my application, bu I want to the application know if the user is Adminstrator or not using C#.
Thanks............................................ .
Jun 12 '07 #1
2 1607
chinu
36
Hello:
I build my application, bu I want to the application know if the user is Adminstrator or not using C#.
Thanks............................................ .
try this
WindowsPrincipal pri = new WindowsPrincipal(WindowsIdentity.GetCurrent());
bool b = pri.IsInRole("Administrators");
Jun 12 '07 #2
Atran
319 100+
try this
WindowsPrincipal pri = new WindowsPrincipal(WindowsIdentity.GetCurrent());
bool b = pri.IsInRole("Administrators");
Thanks chinu...................
Jun 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: D E | last post by:
When using my web application manager (http://localhost:8080/admin) I forgot my password. Is there an XML file i can look at to remember/obtain (possibly even set). Thanks
3
by: Melanie Bergeron | last post by:
Hi all! I want to know what's better between these 2 solutions : CREATE TABLE user ( .... user_type text CHECK(user_type='Root' OR user_type = 'Admin' OR user_type = 'Standard')); ...
11
by: AnhTai | last post by:
Hi all, I've just installed MySQL 5.0 on my sun box (runing Solaris 10, install from blastwave). This is my first time with MySQL so I don't have any exp with it. I have some troubles as: -...
2
by: Annie | last post by:
Hello guys, I have set the MEMBERSHIP, ROLEMANAGER and PROFILE in my config file as below. I just want to use my own sql server 2000 table instead of MSDB.
1
by: mcasaurabhsumit | last post by:
Deletion in DataGrid using Bubbled Event: lblMsg Delete empid empname sal address usertype 13 naresh 7000 ratna giri admin 6 pawan 7000 munirka user 7 sanjeev 8000 munirka super user ...
0
by: Olegus | last post by:
Not sure this is right group to post my question. What is the best way to check that current logged in user has local admin/domain admin rights on a computer? My application needs to be ran under...
0
by: wilkinsonr | last post by:
Hi All, This is the situation. I have a porgram that is in a sub-dir of program files that has an auto-updater. This updater needs to over write both exe's and data files. If the user is not an...
10
by: aniltc | last post by:
I have a list of users(signed for a newsletter).I'm retrieving the list from a database when the admin clicks on a button. There are maximum 10 users diplayed per page.For example,if I had 30 users...
1
nirmalsingh
by: nirmalsingh | last post by:
hai all, in a table user master i have username:Admin , password:admin and userid:1 i have to retrieve user id where username='Admin' and password:'admin' if i enter username='admin' and...
0
by: Big Charles | last post by:
Hello, Programming in VS2003-ASP.NET 1.1, I have this problem: Using DirectoryEntry and without any admin user, how can I check if a domain account, that try to login, has expired? Scenario: User...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.