Question Access Remote Date and Time

Tareq

Member
Joined
Aug 3, 2009
Messages
6
Location
Dhaka, Bangladesh
Programming Experience
3-5
Dear Friends,

Hello for everyone. I am very much familier with VB but now new in VB.NET. Now I have a problem while developing a Standalone project using VB.NET.

Scenario:

I have to develop a project by which my office employees can record their time to enter into the office and leave from the office. I have 10 PCs in my office. All PCs are under network environment. This project is highly related to date and time factor. All PCs are used by an individual employee and can not be restricted to change their own PCs local date and time. So I think my project took the date and time from a central server. Is this possible in VB.NET? If yes, please tell the details.

Thanks for your co-operation.
 
Hello.

Do you use a database with the project which is running on the server? If yes, acquire the timestamp from that one.

Else I could think of a textfile on the server, which gets refreshed every second and can only be read by the employees PCs.

Bobby
 
Dear Friend,

Could you please tell me how I can acquire the timestamp from MS SQL 2000 Server? Please help me in details.

Oh, in addition to your soln I wanna tell that If I manage a text file and get refreshed every second then my server load is H........U.......G.......E.
 
You should ba able to acquire it by something like "SELECT NOW()". This should work on every SQL-Server...though I'm not working with MSSQL.

To the textfile, a little program with a timer which ticks every second and does nothing more then "File.WriteAlltext(yourFile, Date.Now.ToString())" shouldn't produce much payload. But I'm nearly sure this could be done in numerous other ways, f.e. with a simple batch script...

VB.NET:
GOT REDO

:REDO
PING localhost -n 1 > NUL
echo DATE /T > yourfile.txt
echo " " >> yourfile.txt
echo TIME /T >> yourfile.txt

GOTO REDO

Bobby
 
Excellent Robert. Many many thanks for your help. In MS SQL the command is:

SELECT GETDATE()

or

SELECT CURRENT_TIMESTAMP

Thanks for the excellent help again.
 
Back
Top