How to set Read-Only a

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
my output files in vb.net are text files. how to set read-only access to
those files in pocket pc, so that no user can delete it unless the
administrator?

regards,
har
 
Everyone is admin on a Pocket PC. The hack around this may be to keep the
file open at all times.
 
Can anybody suggest a way to set the permission of text files to hidden, read
only, write only etc in vb.net?

Regards,
Hari
 
To set file attributes you can use OpenNETCF.IO.FileEx [1] (from
OpenNETCF.dll). Or you can write your own function by declaring P/Invoke:


<DllImport("coredll", EntryPoint="SetFileAttributes", SetLastError=true)>
Public Shared Function SetFileAttributes(ByVal lpFileName As String,
dwFileAttributes As FileAttributes) As Boolean

Sergey
 
Back
Top