Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to open a text file only through my application but not others?

How to open a text file only through my application but not others?

Scheduled Pinned Locked Moved Visual Basic
questionsysadmintutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cylix2000
    wrote on last edited by
    #1

    In my case, I have a file placed on a file server, I can set the permission about the folder/file. How can I let the user can read the file in the application I create but they cannot direct access the file out of my application?

    R C D 3 Replies Last reply
    0
    • C cylix2000

      In my case, I have a file placed on a file server, I can set the permission about the folder/file. How can I let the user can read the file in the application I create but they cannot direct access the file out of my application?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The only way I can see is to encrypt it so only your code can make sense of it.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      1 Reply Last reply
      0
      • C cylix2000

        In my case, I have a file placed on a file server, I can set the permission about the folder/file. How can I let the user can read the file in the application I create but they cannot direct access the file out of my application?

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        You have to wrap your file access code in some user impersonation code.


        My Blog[^]
        FFRF[^]


        1 Reply Last reply
        0
        • C cylix2000

          In my case, I have a file placed on a file server, I can set the permission about the folder/file. How can I let the user can read the file in the application I create but they cannot direct access the file out of my application?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You can't do that. If you give a user permission to open that file, they can open it using anything, including Notepad or some file byte editor. You're only solution, like Christian said, is to encrypt the file so it can't be understood by anything other that your application.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups