--- In [email protected], Ahmad Sofwan
<[EMAIL PROTECTED]> wrote:
>
> Hi rekan-2 saya ada masalah lagi nich, saya sedang membuat
program billing rental dengan menggunakan aplikasi Visual Basic 6.0
dengan menggunakan server dan client, masalahnya bagaimana cara
mengambil waktu/timer dari komputer server agar komputer server dan
komputer client selalu mempunyai waktu yang sama. atas bantuan dari
rekan-2 saya ucapkan terima kasih
>
> disini saya sertakan alamat email aku : [EMAIL PROTECTED]
>
> salam
>
> jhon lubis
>
>
> Send instant messages to your online friends
http://uk.messenger.yahoo.com
>
> [Non-text portions of this message have been removed]
>
bang jhon kalo di server ada MS SQL Server bisa pake
SQL Syntax GETDATE
Saya punya alternatif kalo di servernya ga ada SQL Server bisa pake
listing ini. Tapi listing ini HANYA BISA digunakan di NT environment
(win nt, 2000, xp). Taruh listing ini di bagian module. Semoga
membantu
cahyo.
Private Declare Function NetRemoteTOD Lib "NETAPI32.DLL" (ByVal
Server As String, buffer As Any) As Long
Private Declare Function NetApiBufferFree Lib "NETAPI32.DLL" (ByVal
buffer As Long) As Long
Private Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory"
(hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Private Type TIME_OF_DAY
t_elapsedt As Long
t_msecs As Long
t_hours As Long
t_mins As Long
t_secs As Long
t_hunds As Long
t_timezone As Long
t_tinterval As Long
t_day As Long
t_month As Long
t_year As Long
t_weekday As Long
End Type
Public Function Get_Date(Server_Name As String) As Date
Dim t As TIME_OF_DAY, tPtr As Long, res As Long, szServer As
String, days As Date, todays As Date
szServer = StrConv(Server_, vbUnicode) 'Convert the server
name to unicode
res = NetRemoteTOD(szServer, tPtr) 'You could also pass
vbNullString for the server name
CopyMemory t, ByVal tPtr, Len(t) 'Copy the pointer returned to a
TIME_OF_DAY structure
days = DateSerial(70, 1, 1) + (t.t_elapsedt / 60 / 60 /
24) 'Convert the elapsed time since 1/1/70 to a date
days = days - (t.t_timezone / 60 / 24) 'Adjust for TimeZone
differences
Get_Date = days
NetApiBufferFree (tPtr) 'Free the memory at the pointer
End Function
Untuk berhenti berlangganan kirim email kosong ke : [EMAIL PROTECTED]
Ikuti juga forum diskusi VB.net dengan
mengirim email kosong ke [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/indoprog-vb/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/