| Author |
Message |
waiting an answer
Guest
|
Posted:
Fri Oct 21, 2005 8:51 pm Post subject:
User Currently logged in |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
 |
|
|
|
|