|
|
|
Как программно (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=38116302&tid=1341952]: |
0ms |
get settings: |
11ms |
get forum list: |
23ms |
check forum access: |
5ms |
check topic access: |
5ms |
track hit: |
99ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
54ms |
get tp. blocked users: |
2ms |
| others: | 256ms |
| total: | 471ms |

| 0 / 0 |
