473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

current user

Hi everyone
I am trying to have the current user name that is logged in to be displayed
in a label or text box in the form. I need some help with the cod to get the
user name.
Thanks for you help...

Oct 3 '08 #1
4 1282
Hi Karim,

label1.Text = My.User.Name
"karim" <ka***@discussions.microsoft.comwrote in message
news:61**********************************@microsof t.com...
Hi everyone
I am trying to have the current user name that is logged in to be
displayed
in a label or text box in the form. I need some help with the cod to get
the
user name.
Thanks for you help...
Oct 3 '08 #2
thank you very much, works great. but I have to click on the label to view
the user name. is there any way to have it show when you open the form with
out clicking the label?
thanks
Oct 3 '08 #3
On Oct 3, 10:14*am, karim <ka...@discussions.microsoft.comwrote:
thank you very much, works great. but I have to click on the label to view
the user name. is there any way to have it show when you open the form with
out clicking the label?
thanks
There's no obligation to put "Label1.Text=My.User.Name" on label's
click event. As you wanted, you can put the code on form's load event
to see UserName in Label1 like this:

Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = My.User.Name
End Sub

Hope this helps,

Onur Güzel

Oct 3 '08 #4
On Oct 3, 7:25 pm, karim <ka...@discussions.microsoft.comwrote:
Hi everyone
I am trying to have the current user name that is logged in to be displayed
in a label or text box in the form. I need some help with the cod to get the
user name.
Thanks for you help...
As far as I know cod is a good fish to eat but I don't think they know
a lot about DSP.
Hardy
Oct 4 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
4
by: Dan Bart | last post by:
I am using an application which is a modification of IBuySpy Portal. It is using Forms authentication. Users login and their name is added to Context Then I use: ...
8
by: Mark White | last post by:
Hey everyone I'm having a great deal of problems finding this information through google and yahoo, so I turn to you on this. I have a Windows app running on XP. I am able to caputre the...
4
by: Leszek | last post by:
Hello! I have my webpage (ASP) in domain (IIS 6.0). I need to make a popup with fullname of current user. How can I do this? Maybe someone have any examples? Thanks!
0
by: davidr | last post by:
Hi, I been stuck on this for a week or more. So please help! I have a menu were a user can click a button and a user control is loaded into the page. A problem occurs when trying to load a...
1
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
4
by: Doogie | last post by:
Hi, I am using HttpContext.Current.User.Identity.Name to get a user id from a web application. I then use that as part of a name of a cookie I'm writing. 30 minutes later I do a refresh of this...
9
by: Alex | last post by:
Get the Name and Phone Number of the Current Windows User in a .NET Application I am writing a simple .NET (C#) application. It needs to "automatic" get the Name (last, first) and phone number...
13
by: bproddu | last post by:
Hi, I'm using Forms authentication for my web app. I've a custom Principal class that I would like to set to the HttpContext.Current.User after the Membership.ValidateUser() passes. I'm able to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.