Questions only for experts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
i have some questions.

1) How can I check, if disk C: is NTFS? And how can i get some others
information about C: like free space or size.
2) How can I get, in which groups (Administrators, Power User ...) is
current logged user?

Thanks a lot
Lubos
 
For the Hard Drive question, you need to have deep look in WMI.
For the User Windows Group question, you can apply this code:

WindowsIdentity userID = WindowsIdentity.GetCurrent();
WindowsPrincipal userPrincipal = new WindowsPrincipal (userID);
if (userPrincipal.IsInRole (WindowsBuiltInRole.Administrator)
{
// Code goes here
}
// for not builtin group
if (userPrincipal.IsInRole ("Domain\\GroupName")
{
// Code goes here
}

Hope that help you, Good luck
 
Back
Top