C++ Username automatisch in Textbox
Hallo und guten Tag,
ich habe für eine Windows Anwedung den unten stehenden Code für den Login, ist es möglich in der TextBox "Benutzername" automatisch den Windows Username einzufügen zu lassen?
Gruß
ich habe für eine Windows Anwedung den unten stehenden Code für den Login, ist es möglich in der TextBox "Benutzername" automatisch den Windows Username einzufügen zu lassen?
InitializeComponent();
PictureBox3.BringToFront();
pictureBox2.Visible = false;
ProgressBar1.Visible = false;
buttonLogin.Enabled = false;
this.Validate();
textBoxBenutzername.Text ="UserName ;
textBoxPasswort.Text = "";
Gruß
Please also mark the comments that contributed to the solution of the article
Content-Key: 395288
Url: https://administrator.de/contentid/395288
Printed on: April 26, 2024 at 13:04 o'clock
2 Comments
Latest comment
Moin Beamter.
Das ist beileibe kein pures C++ da oben ... Das sollte für dich reichen wenn du, wie ich vermute, das .NET im Projekt eingebunden hast:
oder auch
oder auch
usw.
Joooooogle bei dir heute wieder offline?
Für pures c++ siehe https://stackoverflow.com/questions/11587426/get-current-username-in-c-o ...
Das ist beileibe kein pures C++ da oben ... Das sollte für dich reichen wenn du, wie ich vermute, das .NET im Projekt eingebunden hast:
textBoxBenutzername.Text = System.Environment.UserName;
textBoxBenutzername.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
textBoxBenutzername.Text = System.Environment.ExpandEnvironmentStrings("%username%");
Joooooogle bei dir heute wieder offline?
Für pures c++ siehe https://stackoverflow.com/questions/11587426/get-current-username-in-c-o ...