.IsAuthenticated and languages

.IsAuthenticated and languages

Old forum URL: forums.lhotka.net/forums/t/3858.aspx


Michael Hildner posted on Wednesday, November 07, 2007

Greetings,

I usually do C#, trying to work with VB. I have a test project in both languages (Windows forms).

In the startup forms' _Load event, the very first line of code I'm testing for .IsAuthenticated

VB - MessageBox.Show(Csla.ApplicationContext.User.Identity.IsAuthenticated.ToString())

C# - MessageBox.Show(Csla.ApplicationContext.User.Identity.IsAuthenticated.ToString());

I'm a little baffled as to why the VB version returns true and the C# version returns false. When I look at the .User, the .Name is my Windows login name in the VB version and is empty in the C# version.

Anyone know why the difference?

Thanks,

Mike

 

RockfordLhotka replied on Wednesday, November 07, 2007

Yes, VB has some functionality that helps manage the principal automatically. In the project's properties window you can specify whether the default is Windows or manual security, and I think the default is Windows. This is part of the My functionality (My.User) in VB.

Michael Hildner replied on Wednesday, November 07, 2007

Thanks Rocky, I appreciate the info. Interesting to look at the property pages and see what's different, I wouldn't have guessed that you have more/different option just because of the language. Looks like I'll be learning VB :)

Thanks,

Mike

Copyright (c) Marimer LLC