| | |
Visual Basic Employee Clock
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 1001 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application array arrays basic bing button buttons c# center check checkbox code convert crystalreport data database datagrid datagridview date design designer dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert installer intel internet listview mobile monitor net networking objects output panel passingparameters picturebox port position print printing problem read remove save searchbox searchvb.net select serial shutdown soap sorting studio survey table tcp temperature text textbox time timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet visual visualbasic visualbasic.net visualstudio2008 web webbrowser winforms wpf year





