file permission in vb
-
Dear friends:confused: hi!.i m new to vb. can u tell me is there any way to set access permission to the file using vb code so that file can not be shared. actually i have a set up file.after installation i don't want computers to access exe file in a network except one where set up is installed.so can anybody tell me how can i do that.is there any way to code my program so that i can acheive this goal.or any third pary tool is available for that.Please help me. any help will be appriciateable.:confused: be the best...be helpful for others
-
Dear friends:confused: hi!.i m new to vb. can u tell me is there any way to set access permission to the file using vb code so that file can not be shared. actually i have a set up file.after installation i don't want computers to access exe file in a network except one where set up is installed.so can anybody tell me how can i do that.is there any way to code my program so that i can acheive this goal.or any third pary tool is available for that.Please help me. any help will be appriciateable.:confused: be the best...be helpful for others
Disable File Sharing for your App folder and it can only be xecuted from the local computer. However, if the user has sufficient permissions they can share it anyway and still launch your App from the network. I can't check the below code right now, no network. So forgive me if it doesn't work. - Create a new project - Add two labels next to each other on form one.
Private Sub Form_Load() Label1.Caption = "Path:" 'If you only want one instance of your app If App.PrevInstance Then MsgBox "You are not allowed to start more then one instance of My App.", vbExclamation + vbOKOnly, "My App" Unload Me End If Label2.Caption = App.Path 'Display path. ' Check if excuted from network If InStrB(Label2.Caption, "\\") <> 0 Then ' Double slash is network path MsgBox "You are not allowed to start My App from a remote computer.", vbExclamation + vbOKOnly, "My App" Unload Me End If End Sub
Compile the code and run the exe. Run it again while the other is still open and see what happens. Close the exe. Now start it from a different computer on your network and see if it starts or displays the message. HTH Jottum -- modified at 8:45 Friday 11th November, 2005 -
Dear friends:confused: hi!.i m new to vb. can u tell me is there any way to set access permission to the file using vb code so that file can not be shared. actually i have a set up file.after installation i don't want computers to access exe file in a network except one where set up is installed.so can anybody tell me how can i do that.is there any way to code my program so that i can acheive this goal.or any third pary tool is available for that.Please help me. any help will be appriciateable.:confused: be the best...be helpful for others
There's nothing you can do in your code to prevent this. Even if your installation removes the share, there is nothing preventing the admin of the machine from just sharing the folder your app is stored in and nothing you can do to prevent it. You have absolutely no control over this. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome