CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2001
    Location
    israel
    Posts
    99

    read only property

    hello,

    how can i set a file in run-time, to be read only when the user open it?

    thanks,
    ohad


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: read only property

    You can change the attribute to read-only

    SetAttr(file)=1

    Constant Value Description
    vbNormal 0 Normal.
    vbReadOnly 1 Read-only.
    vbHidden 2 Hidden.
    vbSystem 4 System file.
    vbDirectory 16 Directory or folder.
    vbArchive 32 File has changed since last backup.

    To protect from copying your files after installation of the executable file change attrib to anything but 32.
    IF file has been copied then attrib will automaticaly will be 32 (default of copy command).


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured