Pulling the users login name into VB.net
-
How do I get the users login name and pull it into VB? THanks in advance for your help
-
How do I get the users login name and pull it into VB? THanks in advance for your help
you mean this : VB:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim id As String = System.Environment.UserName & Chr(10) & System.Environment.UserDomainName
MessageBox.Show(id)
End Sub
hope that helps, you can also do this : Imports System.Security.Principal <<< at top of form , then this : VB:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim wp As WindowsPrincipal
wp = New WindowsPrincipal(WindowsIdentity.GetCurrent())MsgBox(wp.Identity.Name.ToString) End Sub
:)
Private void ExpectingTwins(string twins)
{
switch(twins)
{
Case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
}
}
-
you mean this : VB:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim id As String = System.Environment.UserName & Chr(10) & System.Environment.UserDomainName
MessageBox.Show(id)
End Sub
hope that helps, you can also do this : Imports System.Security.Principal <<< at top of form , then this : VB:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim wp As WindowsPrincipal
wp = New WindowsPrincipal(WindowsIdentity.GetCurrent())MsgBox(wp.Identity.Name.ToString) End Sub
:)
Private void ExpectingTwins(string twins)
{
switch(twins)
{
Case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
}
}
thanks..thats exactly what i needed