Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# User Name vs VFP User Name
Message
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01675446
Message ID:
01675447
Vues:
70
>Hi,
>
>I find that it is much easier to get username currently logged into the PC using VFP and C#.
>
>In VFP a call to GetEnv("UserName") returns the username of the person currently logged into the PC. Works well.
>
>In C# using Environment.UserName returns the name of the server. Same value no matter who is logged in.
>
>How could I get the username using C#?
>
>TIA

Environment.UserName

https://docs.microsoft.com/en-us/dotnet/api/system.environment.username?view=netcore-3.1
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform