|
|
|
Как программно (C#) прочитать свой логин?
|
|||
|---|---|---|---|
|
#18+
На VB имеется в помощи процедура (How to: Determine a User's Login Name): Function GetUserName() As String If TypeOf My.User.CurrentPrincipal Is Security.Principal.WindowsPrincipal Then ' The application is using Windows authentication. ' The name format is DOMAIN\USERNAME. Dim parts() As String = Split(My.User.Name, "\") Dim username As String = parts(1) Return username Else ' The application is using custom authentication. Return My.User.Name End If End Function А на шарпе (C#) как это может выглядеть? В помощи этот пример для шарпа отсутствует. Пробовал спросить на форуме Windows, но там никто не откликнулся. Видимо, программирование, там не обсуждается. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.01.2013, 13:09 |
|
||
|
Как программно (C#) прочитать свой логин?
|
|||
|---|---|---|---|
|
#18+
... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.01.2013, 13:26 |
|
||
|
|

start [/forum/topic.php?fid=16&msg=38116311&tid=1341952]: |
0ms |
get settings: |
9ms |
get forum list: |
21ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
43ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
49ms |
get tp. blocked users: |
1ms |
| others: | 233ms |
| total: | 378ms |

| 0 / 0 |
