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. Complex Question

Complex Question

Scheduled Pinned Locked Moved C#
csharptoolshelptutorialquestion
13 Posts 10 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.
  • L Lost User

    Hi pals, I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply. Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox. Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the location of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' location, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'. Any Idea how to do that..... please recommend. Sorry for my poor english, Cheers to you, Rajdeep.NET :)

    H Offline
    H Offline
    Henry Minute
    wrote on last edited by
    #2

    For goodness sake man! Google for writing text files c#. You have learned to google by now surely?

    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

    OriginalGriffO 1 Reply Last reply
    0
    • L Lost User

      Hi pals, I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply. Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox. Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the location of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' location, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'. Any Idea how to do that..... please recommend. Sorry for my poor english, Cheers to you, Rajdeep.NET :)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #3

      GOOGLE.....!!! LEARN C# FIRST...!!!

      1 Reply Last reply
      0
      • H Henry Minute

        For goodness sake man! Google for writing text files c#. You have learned to google by now surely?

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #4

        Henry Minute wrote:

        For goodness sake man! Google for writing text files c#. You have learned to google something by now surely?

        Fixed that for you.

        No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        F 1 Reply Last reply
        0
        • L Lost User

          Hi pals, I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply. Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox. Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the location of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' location, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'. Any Idea how to do that..... please recommend. Sorry for my poor english, Cheers to you, Rajdeep.NET :)

          0 Offline
          0 Offline
          0x3c0
          wrote on last edited by
          #5

          .bat files are just renamed text files. Look into the StreamWriter class

          G 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            Henry Minute wrote:

            For goodness sake man! Google for writing text files c#. You have learned to google something by now surely?

            Fixed that for you.

            No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

            F Offline
            F Offline
            fly904
            wrote on last edited by
            #6

            OriginalGriff wrote:

            You have learned to google something by now surely?

            Nope. Answered that for you.

            My failometer is detecting vast quantities of FAIL! "Its SQL - hardly programming..." (Caslen)

            1 Reply Last reply
            0
            • L Lost User

              Hi pals, I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply. Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox. Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the location of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' location, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'. Any Idea how to do that..... please recommend. Sorry for my poor english, Cheers to you, Rajdeep.NET :)

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

              I'm getting very suspicious about what you're trying to do. I would suggest that people here stop helping you until answer the question I asked in my last post to you[^].

              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)
              Why are you using VB6? Do you hate yourself? (Christian Graus)

              1 Reply Last reply
              0
              • 0 0x3c0

                .bat files are just renamed text files. Look into the StreamWriter class

                G Offline
                G Offline
                Guffa
                wrote on last edited by
                #8

                ... or the File.WriteAllText[^] method.

                Despite everything, the person most likely to be fooling you next is yourself.

                0 1 Reply Last reply
                0
                • G Guffa

                  ... or the File.WriteAllText[^] method.

                  Despite everything, the person most likely to be fooling you next is yourself.

                  0 Offline
                  0 Offline
                  0x3c0
                  wrote on last edited by
                  #9

                  Oops. I forgot about that. Thanks for reminding me

                  1 Reply Last reply
                  0
                  • L Lost User

                    Hi pals, I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply. Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox. Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the location of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' location, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'. Any Idea how to do that..... please recommend. Sorry for my poor english, Cheers to you, Rajdeep.NET :)

                    J Offline
                    J Offline
                    J4amieC
                    wrote on last edited by
                    #10

                    So, just to recap. You're trying to: a) Copy the currently running exe b) Hide the console window c) Block access to a folder If this isn't something you shouldn't be writing then im the pope.

                    T 0 2 Replies Last reply
                    0
                    • J J4amieC

                      So, just to recap. You're trying to: a) Copy the currently running exe b) Hide the console window c) Block access to a folder If this isn't something you shouldn't be writing then im the pope.

                      T Offline
                      T Offline
                      Tom Deketelaere
                      wrote on last edited by
                      #11

                      J4amieC wrote:

                      then im the pope.

                      Cool, can I borrow your ferrari please :-D (I was also looking at his profile to see what exactly he is up to and I does seems like this program isn't on the safe side of things.)

                      1 Reply Last reply
                      0
                      • J J4amieC

                        So, just to recap. You're trying to: a) Copy the currently running exe b) Hide the console window c) Block access to a folder If this isn't something you shouldn't be writing then im the pope.

                        0 Offline
                        0 Offline
                        0x3c0
                        wrote on last edited by
                        #12

                        J4amieC wrote:

                        im the pope.

                        Stay away from those kids!

                        1 Reply Last reply
                        0
                        • L Lost User

                          Hi pals, I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply. Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox. Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the location of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' location, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'. Any Idea how to do that..... please recommend. Sorry for my poor english, Cheers to you, Rajdeep.NET :)

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

                          Rajdeep.NET wrote:

                          I am trying to create a small utility which can block folders from direct access.

                          Yeah, with you're skill level, and total lack of knowledge in how Windows works, you're never going to pull this off.

                          A guide to posting questions on CodeProject[^]
                          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                               2006, 2007, 2008

                          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