|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
File ProtectionHi all
I am doing a project in visual basic 6.0 . Is there any option/method to protect a file from deleting. Please help me. On 13 Oct 2005 02:59:54 -0700, "avemariasoftsoluti***@gmail.com"
<avemariasoftsoluti***@gmail.com> wrote: >Hi all Possibly: SetAttrib> >I am doing a project in visual basic 6.0 . > >Is there any option/method to protect a file from deleting. Depends what you are nervous about. <avemariasoftsoluti***@gmail.com> wrote in message
news:1129197593.923921.246860@z14g2000cwz.googlegroups.com... Prevent a file from being deleted?> Is there any option/method to protect a file from deleting. Nothing that the User can't override if they feel so included. The simplest (and the one that /keeps/ catching me out) is to set the File's Hidden or ReadOnly Attribute, as in SetAttr( "file", GetAttr( "file" ) And Not vbHidden ) This takes advantage of the [odd] fact that VB's "Kill" statement, which is how you delete files, is a bit "short-sighted"; make a file Hidden /or/ ReadOnly and "Kill" just can't "see" it to get rid of it. HTH, Phill W. Supose the Folder Option has been set to "show hidden files and
folders" then it is posible to change/delete the file. "AMSS" <avemariasoftsoluti***@gmail.com> wrote in message Belated reply. I am sure you have tried it by now and discovered that "beingnews:1129267179.125524.79600@g49g2000cwa.googlegroups.com... > Supose the Folder Option has been set to "show hidden files and > folders" then it is posible to change/delete the file. > able to see it" in Explorer, makes no difference, to the other's responses. |
|||||||||||||||||||||||