|
i observe that FileSystemRights once changed cant not be reset programmatically through the same APIs.
dSecurity.AddAccessRule(New Security.AccessControl.FileSystemAccessRule("cybergindia\hitesh", FileSystemRights.FullControl, AccessControlType.Deny))
the follwing doesnt seem to work once the rights are set to AccessControlType.Deny.
dSecurity.AddAccessRule(New Security.AccessControl.FileSystemAccessRule("cybergindia\hitesh", FileSystemRights.Read, AccessControlType.Allow))
pls help..
Hitesh sojitra
|
|
|
|
|
I guess perhaps you lose the right to set it to allow, as the user you're logged in as, or running as ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yeah, once the user that runs this code, they give up all of their permissions to modify the access rules. That same user cannot then get it back because they no longer have the permissions to set the access rules.
|
|
|
|
|
ya i gatting same problem.. than what is solution to enable it by code?
Hitesh sojitra
|
|
|
|
|
There is none. You said 'don't let me edit this'. Now you can't edit it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If i set individual permission instead of FullControl than it possible to enable by .Allow option ?
Hitesh sojitra
|
|
|
|
|
I guess try it and see.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i tried but not a single permission could be enabled by .Allow Option
Hitesh sojitra
|
|
|
|
|
You're OBVIOUSLY going to have to use an admin account to grant the permissions back to that user. Then you can go back as that user and try your code again. Please tell me you know how permissions and Windows Security works before you attempt to write code that manipulates it??
BTW: What you're doing is a complete waste of time. You're really not proecting anything by allowing the user to manipulate access rights. There is absolutely nothing stopping the user from resetting the permissions directly on these files/folders from Explorer. Please keep in mind that any code a user launches runs AS the user. There is no special permissions that code gets over and above the permissions the user has who launched it.
|
|
|
|
|
|
first i m using this code to Deny permission
dSecurity.AddAccessRule(New Security.AccessControl.FileSystemAccessRule("cybergindia\hitesh", FileSystemRights.Write, AccessControlType.Deny))
AND
To enable it i Use this code
dSecurity.AddAccessRule(New Security.AccessControl.FileSystemAccessRule("cybergindia\hitesh", FileSystemRights.Write, AccessControlType.Allow))
is it right way ?
Hitesh sojitra
|
|
|
|
|
ok
So sir just you guide me how to enable individual permission of folder/file
Hitesh sojitra
|
|
|
|
|
You're already doing it the correct way. It's your lack of understanding about how permissions work that's going against you.
|
|
|
|
|
ok Thank for help will try and let u know again ......
Hitesh sojitra
|
|
|
|
|
hitesh sojitra wrote: but i don't know in much detail how windows security works ? he
Sorry, this is a topic that is so large, it's covered by entire books. A few forum posts is not going to cover it. Click[^]
|
|
|
|
|
Hello,
I'd like to know if there is a way to lock an XML file with a password?
Im asking this because my program stores an XML file with personal information which doesn't have to be shared with the whole world I don't want to do this with a 3rd party program like KeePass, my program has to do it.
--Zaegra--
|
|
|
|
|
Well, an XML file is obviously just a text file. So, you can encrypt it, and store it in that format and decrypt it in memory, or you can just encrypt the sensitive data you store in there. The Cryptography namespace is where you find the tools to do this.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
But the Cryptography only encrypts bytes and not strings. How to convert a string to a byte?
|
|
|
|
|
Use the Encoding class in System.Text.
Sincerely,
/ Andreas Jonsson.
|
|
|
|
|
Password on a file?? Nope. This is stuff you only see in the movies. NTFS does not support passwords on individual files and folders. AFAIK, there isn't a single O/S filesystem out there that does.
|
|
|
|
|
You're big on movies suddenly ? :P
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yeah, that kind of happens when you're sitting up all night with the new munchkin because he doesn't want to sleep at all. There's really nothing on at 3:00am except what NetFlix sends you. I've watched more movies in the last 2 weeks than I have in the last 2 years.
|
|
|
|
|
hi all
I have developed my window base application in vb.net/mssql express.
my client has more 10 pc & he wants to connect all the pcs to his pc.usign LAN and Internet Connections.
Is it Posible?
if yes Pl send me examples with codes.
Thanks
rmshah
Developer
|
|
|
|
|
Using an internet connection, he needs to set up a VPN, then he'll be doing it the same as on a LAN.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The code would be the same as with any other LAN connection to an SQL Server. Just adding "through the internet" to the requirements doesn't change the code.
Also, noone is their right mind would expose an SQL server directly to the internet. You ALWAYS put it behind firewalls and VPN tunnels for security reasons. An much greater understanding of networking is required to solve this problem, not code.
|
|
|
|