Ne, ne treba ti referenca na "coredll" vec samo ovo sto sam ti napisao
Pametno bi bilo da napravis klasu.
Npr.
Code:
Imports System.Runtime.InteropServices
Public Class SystemTime
<StructLayoutAttribute(LayoutKind.Sequential)> _
Private Structure SYSTEMTIME
Public year As Short
Public month As Short
Public dayOfWeek As Short
Public day As Short
Public hour As Short
Public minute As Short
Public second As Short
Public milliseconds As Short
End Structure
<DllImport("coredll.dll")> _
Private Shared Function SetLocalTime(ByRef time As SYSTEMTIME) As Boolean
End Function
Public Sub SetSysTime(ByRef NewDate As DateTime)
Dim st As SystemTime
st.year = Convert.ToInt16(NewDate.Year)
st.month = Convert.ToInt16(NewDate.Month)
st.dayOfWeek = Convert.ToInt16(NewDate.DayOfWeek)
st.day = Convert.ToInt16(NewDate.Day)
st.hour = Convert.ToInt16(NewDate.Hour)
st.minute = Convert.ToInt16(NewDate.Minute)
st.second = Convert.ToInt16(NewDate.Second)
st.milliseconds = Convert.ToInt16(NewDate.Millisecond)
SetLocalTime(st)
End Sub
End Class
I to bi bilo to
Edit: Kasno marko na kosovo stize :)
[Ovu poruku je menjao StrokaviKod dana 30.08.2006. u 11:07 GMT+1]