| | |
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 30minutes 2005 2008 access account arithmetic array arrays basic binary bing button buttons c# center check checkbox code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images inline insert intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save searchbox searchvb.net select serial server soap sql table tcp text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





