Formular una preguntaFormular una pregunta
 

RespondidaHide a .txt file.

Respuestas

  • miércoles, 04 de noviembre de 2009 21:11jinzai Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    The simplest thing is to make the file read only. Hiding it will only protect you from the mildly curious. I have my systems set to show hidden files...that is not at all uncommon.
  • miércoles, 04 de noviembre de 2009 21:19jwavila Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    how are you going to write to this file if you don't want it modified?



    you can set the File Attributes to ReadOnly, but...

    I guess you could check if the User is you, and if so set it to read/write. If not you set it to ReadOnly. Don't know if that would work, but worth a try

    see this link for setting the Attributes

    http://www.dreamincode.net/forums/showtopic31134.htm
  • miércoles, 04 de noviembre de 2009 21:55kaymaf Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    I have a Windows app, which reads and writes to a flat file (.txt file). I don't want user to modify this file. What are my options? Thanks.

    You should consider different method to protect file from tampering, Readonly and Hidden will not work because user can remove readonly attribute from file through properties. You can use resgistry or encrypt/encode the text before save to file. Also, you can put the text file in IsolatedStorage

    kaymaf
    If that what you want, take it. If not, ignored it and no complain

Todas las respuestas

  • miércoles, 04 de noviembre de 2009 20:58ShariqDON Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    i have a Idea Or suggession....
    You can Also Encrypt it...... With Text Replacement Method....

    http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/1e0c977f-d023-4e8f-b551-24e15108b4ab




    www.shariqdon.media.officelive.com
  • miércoles, 04 de noviembre de 2009 21:11jinzai Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    The simplest thing is to make the file read only. Hiding it will only protect you from the mildly curious. I have my systems set to show hidden files...that is not at all uncommon.
  • miércoles, 04 de noviembre de 2009 21:19jwavila Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    how are you going to write to this file if you don't want it modified?



    you can set the File Attributes to ReadOnly, but...

    I guess you could check if the User is you, and if so set it to read/write. If not you set it to ReadOnly. Don't know if that would work, but worth a try

    see this link for setting the Attributes

    http://www.dreamincode.net/forums/showtopic31134.htm
  • miércoles, 04 de noviembre de 2009 21:41Balaji Baskar Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Tiene código
    By Using VB.Net you can use following ways to secure your file to an extend. Either you can mark your file as ReadOnly, Hidden or as a System File.

    Dim attribute As System.IO.FileAttributes = IO.FileAttributes.Encrypted
    System.IO.File.SetAttributes("file1.txt", attribute)
    
    Dim attribute As System.IO.FileAttributes = IO.FileAttributes.Hidden
    System.IO.File.SetAttributes("file1.txt", attribute)
    
    Dim attribute As System.IO.FileAttributes = IO.FileAttributes.System
    System.IO.File.SetAttributes("file1.txt", attribute)
    
    

     


    Balaji Baskar [Please mark the post as answer if it answers your question]
  • miércoles, 04 de noviembre de 2009 21:55kaymaf Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    I have a Windows app, which reads and writes to a flat file (.txt file). I don't want user to modify this file. What are my options? Thanks.

    You should consider different method to protect file from tampering, Readonly and Hidden will not work because user can remove readonly attribute from file through properties. You can use resgistry or encrypt/encode the text before save to file. Also, you can put the text file in IsolatedStorage

    kaymaf
    If that what you want, take it. If not, ignored it and no complain
  • miércoles, 04 de noviembre de 2009 22:31JohnWein Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hide it in an image using steganography.