| | |
Visual Basic Employee Clock
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 86
Reputation:
Solved Threads: 0
hey guys im fairly new to visual basic, but very eager to learn it. I am attempting to make an employee clock in.
I want to make a simple clock in that will ask the user to enter their name, and just click a button that will then post that time.
I would then like to get the time and name of the user and dump it into a .txt file
Is there anyway that when the user clicks a button i can grab the current system time and throw it into a label?
How can the program save the information. The user will be clicking on the .exe of the program. When they clock in and the time is visible on the form they will exit the program. Will the program automatically save the clock in time inside the label or when the program restarts it will need to read the time from the .txt file?
I want to make a simple clock in that will ask the user to enter their name, and just click a button that will then post that time.
I would then like to get the time and name of the user and dump it into a .txt file
Is there anyway that when the user clicks a button i can grab the current system time and throw it into a label?
How can the program save the information. The user will be clicking on the .exe of the program. When they clock in and the time is visible on the form they will exit the program. Will the program automatically save the clock in time inside the label or when the program restarts it will need to read the time from the .txt file?
•
•
Join Date: Feb 2009
Posts: 6
Reputation:
Solved Threads: 0
I think this addresses your needs:
VB.NET Syntax (Toggle Plain Text)
Private Sub btnClockIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClockIn.Click Dim Time As String = Now() Dim Name As String = txtName.Text 'writes time to label on form lblTime.Text = Time 'write to file Dim oFile As System.IO.File Dim oWrite As System.IO.StreamWriter oWrite = oFile.CreateText("C:/test.txt") oWrite.WriteLine(Name & "," & Time) oWrite.Close() End Sub
•
•
Join Date: Jul 2008
Posts: 86
Reputation:
Solved Threads: 0
i made a simple one like this one:
I was wondering if it was possible to include the name of the current user logged into the computer to the text file. Could this be done?
VB.NET Syntax (Toggle Plain Text)
Using outFile As StreamWriter = New StreamWriter("blahblah.txt") outFile.Write("Clock In: " + TimeOfDay) End Using
I was wondering if it was possible to include the name of the current user logged into the computer to the text file. Could this be done?
•
•
Join Date: Feb 2009
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
i made a simple one like this one:
VB.NET Syntax (Toggle Plain Text)
Using outFile As StreamWriter = New StreamWriter("blahblah.txt") outFile.Write("Clock In: " + TimeOfDay) End Using
I was wondering if it was possible to include the name of the current user logged into the computer to the text file. Could this be done?
VB.NET Syntax (Toggle Plain Text)
Dim UserName As String = Environ("USERNAME")
•
•
Join Date: Nov 2008
Posts: 63
Reputation:
Solved Threads: 10
My.User.Name
Environment.UserName.ToString()
You can checkout the My or Environment objects to find more interesting things.
The My.Computer.Clock object provides properties to find the current local time for the computer and the UTC time. It also exposes the millisecond count from the computer's system timer.
Environment.UserName.ToString()
You can checkout the My or Environment objects to find more interesting things.
The My.Computer.Clock object provides properties to find the current local time for the computer and the UTC time. It also exposes the millisecond count from the computer's system timer.
![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: How to change screen resolution programmatically in vb.net 2.0?
- Next Thread: Viewing Data in Datagrid
| Thread Tools | Search this Thread |
.net .net2008 2008 access add advanced application array basic beginner browser button buttons center click client code combo cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse employees excel exists fade filter forms html images input listview map mobile module msaccess mysql net number objects open pan panel pdf picturebox picturebox2 port position print printing printpreview read regex remove reuse right-to-left save search searchvb.net serial settings shutdown socket sqldatbase sqlserver storedprocedure survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol vb vb.net vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winforms winsock wpf wrapingcode xml year





