User Currently logged in
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
User Currently logged in

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
waiting an answer
Guest





Posted: Fri Oct 21, 2005 8:51 pm    Post subject: User Currently logged in Reply with quote

hi all ...
how do i get the currently logged user in the protal ?
Back to top
Guest






Posted: Fri Oct 21, 2005 8:51 pm    Post subject: Re: User Currently logged in Reply with quote

Via code? You can write a web part that will retrieve that data based
off the current thread. Let us know what exactly you are trying to do.
Back to top
Similar problem!
Guest





Posted: Sat Oct 22, 2005 6:46 am    Post subject: Re: User Currently logged in Reply with quote

How about this scenario?

Every time, one user logs on the portal, I would like to retrieve some
specific information owned by the user and stored in sql server database.

the page in the web part is an asp.net page.

is there any way programatically?

Thanks,

"erikpaulmiller@gmail.com" wrote:

Quote:
Via code? You can write a web part that will retrieve that data based
off the current thread. Let us know what exactly you are trying to do.

Back to top
waiting an answer
Guest





Posted: Sun Oct 23, 2005 8:50 am    Post subject: Re: User Currently logged in Reply with quote

sure i am looking for a code to solve that .. i made something like that..

SPSite mysite=new SPSite("http://ur_portal");
SPWeb myweb=mysite.OpenWeb();
SPUser me=myweb.CurrentUser;
string username=me.LoginName

i will put that with a web part in the targeted page..
there is a class i think (UserProfile) that give u information about
specific account..
since u have the (LoginName) and the (.Net Environment) u can so easy store
ur information about this user in sql database.

"Similar problem!" wrote:

Quote:
How about this scenario?

Every time, one user logs on the portal, I would like to retrieve some
specific information owned by the user and stored in sql server database.

the page in the web part is an asp.net page.

is there any way programatically?

Thanks,

"erikpaulmiller@gmail.com" wrote:

Via code? You can write a web part that will retrieve that data based
off the current thread. Let us know what exactly you are trying to do.

Back to top
Guest






Posted: Mon Oct 24, 2005 8:51 pm    Post subject: Re: User Currently logged in Reply with quote

Since SPS is windows authenticated site you can get the domain user
based off if the current thread.

string userName =
System.Threading.Thread.CurrentPrincipal.Identity.Name;

That should give you DOMAIN\UserName. UserProfile is part of ASP.NET
2.0 I believe. There is a User that is part of the Page object with
ASP.NET.
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB