Jeg kan se der er noget med fileshare
Jeg har brug for at sætte permissions på et share kan nogen hjælpe med det.
"Jesper Højgaard" <jhoejgaard@NOSPAMdeloitte.dk> skrev i en meddelelse
news:95m7ln$srs$1@news.inet.tele.dk...
> Takker Anton
>
> Her er koden, hvis andre er interesseret:
>
> Private Type FILETIME
> dwLowDateTime As Long
> dwHighDateTime As Long
> End Type
>
> Private Type SYSTEMTIME
> wYear As Integer
> wMonth As Integer
> wDayOfWeek As Integer
> wDay As Integer
> wHour As Integer
> wMinute As Integer
> wSecond As Integer
> wMilliseconds As Integer
> End Type
>
> Private Const GENERIC_WRITE = &H40000000
> Private Const OPEN_EXISTING = 3
> Private Const FILE_SHARE_READ = &H1
> Private Const FILE_SHARE_WRITE = &H2
> Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA"
> (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal
> dwShareMode As Long, ByVal lpSecurityAttributes As Long, ByVal
> dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal
> hTemplateFile As Long) As Long
> Private Declare Function SetFileTime Lib "kernel32" (ByVal hFile As Long,
> lpCreationTime As Long, lpLastAccessTime As Long, lpLastWriteTime As
> FILETIME) As Long
> Private Declare Function SystemTimeToFileTime Lib "kernel32" (lpSystemTime
> As SYSTEMTIME, lpFileTime As FILETIME) As Long
> Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As
Long)
> As Long
> Private Declare Function LocalFileTimeToFileTime Lib "kernel32"
> (lpLocalFileTime As FILETIME, lpFileTime As FILETIME) As Long
>
> Private Sub SetFileTime2(ByVal FileName As String, ByVal FileDate As Date)
> Dim m_Date As Date
> Dim lngHandle As Long
> Dim udtFileTime As FILETIME
> Dim udtLocalTime As FILETIME
> Dim udtSystemTime As SYSTEMTIME
>
> m_Date = FileDate
>
> udtSystemTime.wYear = Year(m_Date)
> udtSystemTime.wMonth = Month(m_Date)
> udtSystemTime.wDay = Day(m_Date)
> udtSystemTime.wDayOfWeek = Weekday(m_Date) - 1
> udtSystemTime.wHour = Hour(m_Date)
> udtSystemTime.wMinute = Minute(m_Date)
> udtSystemTime.wSecond = Second(m_Date)
> udtSystemTime.wMilliseconds = 0
>
> ' convert system time to local time
> SystemTimeToFileTime udtSystemTime, udtLocalTime
> ' convert local time to GMT
> LocalFileTimeToFileTime udtLocalTime, udtFileTime
> ' open the file to get the filehandle
> lngHandle = CreateFile(FileName, GENERIC_WRITE, FILE_SHARE_READ Or
> FILE_SHARE_WRITE, ByVal 0&, OPEN_EXISTING, 0, 0)
> ' change date/time property of the file
> SetFileTime lngHandle, vbNull, vbNull, udtFileTime
> ' close the handle
> CloseHandle lngHandle
> End Sub
>
> Anton Vestergaard <anton_dkNONO@hotmail.com> wrote in message
> news:95m3lh$aan$1@news.inet.tele.dk...
> > Prøv at kigge på API-kaldet SetFileTime.
> > Mangler du et eksempel, så kig på
www.allapi.net
> >
> > "Jesper Højgaard" <jhoejgaard@NOSPAMdeloitte.dk> skrev i en meddelelse
> > news:95m35n$llc$1@news.inet.tele.dk...
> > > Jeg er i gang med et projekt, hvor jeg har behov for at sætte datoen
på
> en
> > > file, altså den dato,, hvor den sidst er rettet. Er der noget der
ligger
> > > inde med kode til det?
>
>
>