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. C#
  4. Prevent un-authorised access to files.

Prevent un-authorised access to files.

Scheduled Pinned Locked Moved C#
htmlhelp
12 Posts 6 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.
  • K Offline
    K Offline
    Karmendra Suthar
    wrote on last edited by
    #1

    Hi, I have help files written in HTML, which I display in my Win Form application using Web Browser component. But now I need to make sure that these files should be accessed only by my application, user should not be able to access these files from the location where these files are installed. Thanks, Karmendra

    _ W W D L 5 Replies Last reply
    0
    • K Karmendra Suthar

      Hi, I have help files written in HTML, which I display in my Win Form application using Web Browser component. But now I need to make sure that these files should be accessed only by my application, user should not be able to access these files from the location where these files are installed. Thanks, Karmendra

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Keep the help files encrypted and decrypt them before displaying them from your application.

      «_Superman_»

      K 1 Reply Last reply
      0
      • K Karmendra Suthar

        Hi, I have help files written in HTML, which I display in my Win Form application using Web Browser component. But now I need to make sure that these files should be accessed only by my application, user should not be able to access these files from the location where these files are installed. Thanks, Karmendra

        W Offline
        W Offline
        Wendelius
        wrote on last edited by
        #3

        If you protect the files so that they are not accessible by the user, then they wouldn't be accessible by your application which the user runs. Possibly one way could be that you embed the help files to your application. In that case you don't have a separate help file at all. However, then you should extract the help and store it somewhere when you want to show it.

        The need to optimize rises from a bad design.My articles[^]

        K 1 Reply Last reply
        0
        • _ _Superman_

          Keep the help files encrypted and decrypt them before displaying them from your application.

          «_Superman_»

          K Offline
          K Offline
          Karmendra Suthar
          wrote on last edited by
          #4

          Hi, I thought of the same thing, but I was wondering how to do it, can you tell me how can I encrypt ant keep the html files and then how can I decrypt it in the application. Thanks, Karmendra

          1 Reply Last reply
          0
          • W Wendelius

            If you protect the files so that they are not accessible by the user, then they wouldn't be accessible by your application which the user runs. Possibly one way could be that you embed the help files to your application. In that case you don't have a separate help file at all. However, then you should extract the help and store it somewhere when you want to show it.

            The need to optimize rises from a bad design.My articles[^]

            K Offline
            K Offline
            Karmendra Suthar
            wrote on last edited by
            #5

            Hi, I meant users should not access the files directly in the installation folder and open and view it using there internet browser. The only way for them to access those files is via my application. As you suggest embedding it, can you tell me how that can be done, sorry This might be silly to ask but I am very new to .NET and C# Thanks for you help and time Regards, Karmendra

            W 1 Reply Last reply
            0
            • K Karmendra Suthar

              Hi, I meant users should not access the files directly in the installation folder and open and view it using there internet browser. The only way for them to access those files is via my application. As you suggest embedding it, can you tell me how that can be done, sorry This might be silly to ask but I am very new to .NET and C# Thanks for you help and time Regards, Karmendra

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              I think that the problem is that your web browser shows the document based on URL. So in my understanding you must point the url to a valid location where the html is located. Now where ever you store the html, I think it needs to be in a file, in clear format the moment the browser accesses it. If you embed it, you could write a temporary file and get the contents using GetFile method in Assembly class. After the help is closed, you would remove the remporarty file. The file itself is included in the project using Add Existing item in Project Explorer.

              The need to optimize rises from a bad design.My articles[^]

              1 Reply Last reply
              0
              • K Karmendra Suthar

                Hi, I have help files written in HTML, which I display in my Win Form application using Web Browser component. But now I need to make sure that these files should be accessed only by my application, user should not be able to access these files from the location where these files are installed. Thanks, Karmendra

                W Offline
                W Offline
                WritinCode
                wrote on last edited by
                #7

                Encrypting the files individually would probably be less intrusive if you needed to update a single help file whereas there is no change to the application. You could embedd them but that would mean any change to the help file requires a new binary. From a support perspective, keep them seperate. Schott

                1 Reply Last reply
                0
                • K Karmendra Suthar

                  Hi, I have help files written in HTML, which I display in my Win Form application using Web Browser component. But now I need to make sure that these files should be accessed only by my application, user should not be able to access these files from the location where these files are installed. Thanks, Karmendra

                  D Offline
                  D Offline
                  DaveyM69
                  wrote on last edited by
                  #8

                  A combination of the suggestions above - why not create a seperate assembly that creates the html in memory or has them embedded - and use that to serve the html source to your main app. An update to the help would just require that dll to be redistributed.

                  Dave
                  BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                  Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

                  K 1 Reply Last reply
                  0
                  • K Karmendra Suthar

                    Hi, I have help files written in HTML, which I display in my Win Form application using Web Browser component. But now I need to make sure that these files should be accessed only by my application, user should not be able to access these files from the location where these files are installed. Thanks, Karmendra

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #9

                    Unreadable help files? great idea. :omg:

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).


                    modified on Friday, June 10, 2011 12:18 PM

                    K 1 Reply Last reply
                    0
                    • L Luc Pattyn

                      Unreadable help files? great idea. :omg:

                      Luc Pattyn [Forum Guidelines] [My Articles]


                      I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).


                      modified on Friday, June 10, 2011 12:18 PM

                      K Offline
                      K Offline
                      Karmendra Suthar
                      wrote on last edited by
                      #10

                      :-D These help files are not related to using the software it is having information related to any experiment, and in Examination mode I do not want users to see them.

                      L 1 Reply Last reply
                      0
                      • D DaveyM69

                        A combination of the suggestions above - why not create a seperate assembly that creates the html in memory or has them embedded - and use that to serve the html source to your main app. An update to the help would just require that dll to be redistributed.

                        Dave
                        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

                        K Offline
                        K Offline
                        Karmendra Suthar
                        wrote on last edited by
                        #11

                        Hi, Thanks for all you r efforts, but i am very new .Net C#, I am not sure what you mean "embed the html", Do you mean write code that will generate the Html? Please Explain. Thanks, Karmendra

                        1 Reply Last reply
                        0
                        • K Karmendra Suthar

                          :-D These help files are not related to using the software it is having information related to any experiment, and in Examination mode I do not want users to see them.

                          L Offline
                          L Offline
                          Luc Pattyn
                          wrote on last edited by
                          #12

                          Hi, you could add an "enter password" dialog to the HTML code, have most of the page content encrypted and include some JavaScript that checks the password and decrypts the text. Don't ask me for details though, I'm not inclined to do such things myself. I'd rather create my own file type and non-HTML browser. :)

                          Luc Pattyn [Forum Guidelines] [My Articles]


                          I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).


                          modified on Friday, June 10, 2011 12:19 PM

                          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