Deleting the data in DLL
After building of any C# project we will get a dll, and I need to place that dll in bin folder of sharepoint virtual directory(its a webpart..and I must place in bin folder not any 开发者_JAVA百科other location). My question is when a user login he can edit the DLL in notepad and can delete the data and save. I would like to prevent him not to open in any editor (Notepad, Wordpad etc.). How can I do this? I gave the permissions to the folder as read still I am able to save it.
Editing a dll in notepad and saving will corrupt it ( assuming anything allows you to do this ).
The solution is to only provide read permissions to the web site users on this folder - there is no reason for end users to have permissions on this, and it is dangerous.
I think (guessing) perhaps you're getting mixed up between DLL and .dwp - the web part properties file which is XML.
This is the file you get if you "Export" a web part from the UI - it doesn't contain any code, its just xml text file with the properties.
There is no way that a user can modify a WebPart DLL via the SharePoint interface - they would need access to the server via Remote Desktop etc. and administrator permissions. Even with access - they are not going to be able to edit using Notepad - that would be like editing a video with a text editor!?
So how do you stop a user modifying the .dwp? One idea (assuming you've got a custom web part) is that instead of storing the web part properties in plain text key/value pairs in the XML you can store them as a single encrypted string.
If this is not what you mean can you please clarify your question.
Even if you secure your DLL in some way, no idea honestly how, this potential user can just delete your DLL and break your system. In IT there is a limit between what you should worry about and what you better leave there.
You can invent whatever security you want, but there will be always at least one client able to break all. So I would say in your concrete case, just don't worry about stuff like this and go ahead. Also, just as @Cat mentioned, editing a DLL with, let's say Notepad, will only corrupt it.
Hope this helps.
精彩评论