Muhammad Irshad

Muhammad Irshad

  • NA
  • 55
  • 39.2k

Difference in WinForm Application and WPF Application

Apr 12 2012 8:51 AM
Hi Guys,

There is interesting problem down here.
I use this code
 
If My.User.CurrentPrincipal.IsInRole("Administrators") Then
MsgBox("Administrator")
Else
 MsgBox("Not Administrator") 
End If

in two different applications with below specs:
1. Windows Form Application with .NET Framework 3.5 (VB.NET)
2. WPF Windows Applciation with .NET Framework 3.5 (VB.NET)

In WinForm app it shows Administrator in Message Box. But, in WPF it shows Not Administrator.
What is reason behind this ? Any idea ?
Thanks,

Regards,
Itz.Irshad


Answers (5)