Security :: Programmatically Set Share Permission To A Shared Folder In C#?

Feb 9, 2010

i have a situation where i need to develop a web system where sys. admin can create a shared folder in server and set who can access the shared folder programmatically.

i've manage to find example to create a shared folder from here:[URL]

and i also manage to find example to add user and set folder Security setting from here:[URL]

My problem is how can i add user in the Sharing permission setting since it is a shared folder. Default sharing setting is set to 'everyone'. This mean anyone in my company can browse to the shared file unless i set everyone security setting. I want to remove "everyone" and add users based on the user that i've already add at Security setting.

View 7 Replies

Similar Messages:

How To Get The Unc Share Name Of A Given Folder (If Shared)

Oct 26, 2010

How To Get The Unc Share Name Of A Given Folder (If Shared)?

View 2 Replies

C# - Create Folder Programmatically In DotNetNuke And Assign Permission To It?

Feb 7, 2011

I have created a folder in DotNetNuke programmatically on the root portal directory. I just want to assign permissions to it only one time, for example I want to make it read only for authenticated users. Any advice on how to accomplish this using C# or VB.NEt?

View 1 Replies

Security :: Can't Find A Link About Grant Permission Programmatically

Oct 11, 2010

two weeks ago I read a MSDN(?) article how to grant/revoke permission for some users/roles/groups on a specific page or holder temporarily or with condion. The article shows how to do it Form_Load() in c#. But I can't find the link with googling or in MSDN library.

Please let me know if you know the url?

What I want to do is:

There is a folder called employeePDFs.

The folder will have 1000s employees' sub folder ({lastname}{firstname}{employeeID}). Each folder will have very personal indivual PDF files which are manually uploaded.

If an employee logs on, then the logon employee can view a page which has a list of PDF files in his own folder only.

Those PDF files can be assessed only by the user.

View 1 Replies

Security :: Create Folder And Set Permission?

Nov 10, 2010

I develop one application that create folder with special permission.

It works, but when I install the application on server I can't set any permission.

I think because it needs domain admin to set this permission... I've one account of one domain admin but how can I do to impersonate when the application set (try to set...) the permission ?

View 2 Replies

Security :: Giving Folder Read / Write Permission In Server?

Jun 14, 2010

I need to set folder permission programmaticcaly which is in my GoDaddy server. I have nearly 150 folders in my server so I cant change through server settings or IIS settings. I am using web application. My folder may go on increase in future.I have googled a lot of things.

1. Like Access Control List in System.SEcurity namespace

I cant able to change the file permission but not a directory.

I must allow all the users to write or move a file to the folder which is in read only mode. That should be done programmatically and should be dynamic.

View 2 Replies

Security :: How To Access Shared Folder

Nov 28, 2010

I am trying to access a shared folder which is located on a different server rather than on the server.

I configured windows authentication and set impersonation to true. Also try with enable/disable basic authentication.

I have tried the following:

with a mapped driveshared folder access (\sharedfolder)virtual directory pointing to shared folder with pass through configuration. However none of the above works. I am getting "Access Denied" error when trying with shared folder and virtual directory. In the case of mapped drive getting "Not Found" error.

View 4 Replies

Security :: Folder Permission Running Locally / Attrib Command Is Not Working

Jun 28, 2010

I have a very simple and stupid problem but I'm unable to find a solution. I'm trying to create folders and files locally through my code, however I get a permission exception when I try to write in a folder in my application. Normally I'd run this on a remote server, and ask the system administrator for writing permission on this specific folder, but I need to run this locally for the moment.

If I navigate to the file in windows explorer, and right click the folder and click on Properties, I can see that it's set as Read Only. However when I try to disable this tickbox and click on Accept, nothing happens. It ignores me, and next time I open the Properties of this same folder, it's still marked as Read Only.

I've googled this and found a solution which implies using MS-DOS and a command named "attrib". This is not working for me either. I also read about adding an ASP.NET account on my PC and granting the right permissions to this, but I'm not sure how to do is.

View 8 Replies

Security :: Browsing Server Share Folder Using Unc?

Jun 16, 2010

I've developed a file browser that will browser a different server shared folder. In order to get this working I'm using the unc path (\ServerSharedFolder) to return the files/folders. I've also added the following to my webconfig to get around the security <identity impersonate="true" userName="domainadmin"
password="password" />

It's simply a file browser, no create or delete functions will occur. The solution works and what I want to know is that this the safest way to do this? or the best way? I did try to use a virtual directory instead of unc path but would support this.

View 1 Replies

Security :: Want To Log Into A Shared Folder On Another Server Using A Different User Name And Password?

Feb 22, 2010

I have an app written in c# and want to log into a shared folder on another server using a different user name and password.

How do I and can you give me some example code to allow me to connect to a shared folder on another server using a different user name and password.

Once connected, I wish to update a txt file

StreamWriter sw = File.AppendText(@\flcy_fluencyDNC_ListsTenantDNC.txt);

View 3 Replies

Security :: Create And Write File In "C:windowssystem32" This Path / Want Some Code In C# Who Give The Permission To Folder?

Oct 7, 2010

I want to create and write file in "C:windowssystem32" this path.some computer give the error access denied.i want some code in C# who give the permission to folder.

View 5 Replies

Give Permission To User Programmatically

Feb 7, 2011

i use this codes to give permision to user for some pages


i know that i can use IsUserInRole("UserName") method to give permision to user but, i'm looking for something else because, i can't check all roles for all pages and also i write the code in web.config file because of i use sitemap for menu and with this method i can show the user that part that's allow for that user. now my question is: can i write some code to do the same method that, i write some codes in web.config file?

View 1 Replies

Set The Folder Permission Which Is Out Of IIS

Dec 3, 2010

I need the settings in web.config file of my application through which i can set permission for particular folder outside IIS. I need this functionality through settings in web.config.

Edited: I need to know that how can we apply impersonation in web.config file

View 1 Replies

Folder Permission On Server While Uploading?

Sep 28, 2010

I want to upload files in my application on server but I have to grant it R/W access so that I or anyone can upload files in it. Is there any way that I write some code or configuration lines in Web.config which solve this permission problem?

View 1 Replies

Configuration :: How To Give Folder Permission Through Ftp

Jun 11, 2010

I have deployed my website in ftp i need to upload image to my database and place images in upload folder. while uploading images i'm getting the below error.

Access to the path 'd:hostingmystieproductImagesvaara.jpg' is denied.


An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details:

System.UnauthorizedAccessException: Access to the path 'd:hostingmysiteproductImagesvaara.jpg' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

View 1 Replies

How To Retain Folder Permission During Website Deployment

Mar 3, 2010

I have a production website that, once built in TFS is re-deployed and updated using xcopy. The entire site (excluding the root directory) it deleted then the new site copied in. This works well.

We use a 3rd party charting package that creates images at runtime and then renders a link to them. In order to do this it needs write permissions to a browsable folder.

Unfortunately, every time we update the website the write permissions of IIS_USRS is lost. Is there any way to retain this?

View 1 Replies

Iis6 - Folder Permission For Uploading Files

Jun 9, 2010

I set all the permissions correctly (I think), but I still can't upload file on the server. I am receiving error that access is denied when I am trying to upload the file.

I set the permissions to be able to write for Internet guest, network service and in both physical folder and in the iis.

View 2 Replies

SQL Server :: Windows Shared Hosting Error: Create Database Permission Denied In Database 'master'?

Mar 1, 2011

how I can correct an error. I've built the MVCMusicStore tutorial here:

The first time I visit the site and attempt a database connection I get this error:

Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.

But when I refresh, it all works fine. I'm at a bit of a loss. I don't believe I'm attempting to create a database, but I realise that the error may not really have anything to do with that. This is hosted at GoDaddy shared hosting. The database was created and I used an SQL script to create the tables initially and populate the data. My connection string works as I can pull data from the database, but I do have
a feeling it will be a web.config setting that will correct this.

View 3 Replies

Configuration :: Give Website Permission To See Folder On The Server?

May 13, 2010

How can I give my website permission to see this folder on the server? C:PVSWin. The website is actually running on a virtual path D:WebSitesAdco.We are running IIS ver 6.The website uses a table from Pervasive to locate Vendors. The SqlDataSource works from the VS2008 IDE which is running on the server, but if a user logs into the website remotely they get this error:ERROR [IM003] Specified driver could not be loaded due to system error 1114 (Pervasive ODBC Client Interface). This error generally indicates that the path to the DB components is not found, or is not available to the calling program, so I guess that the website does not have permissions.

View 5 Replies

How To Access To Share Folder

Mar 15, 2011

I need to temporarily access the network to separate directories. When do it I have access exception. I'm from Ukraine. not sure about the accuracy of the translation. "Logon not produced: Username or password not recognized"

access from my PC to the share directory I have >> Start >> Run >> \network addres

View 1 Replies

Folder Permission / Restrict Users, That Each User Sees Only Files

Apr 3, 2011

I have an application. There is a folder in the project that users upload images and files to that folder.

I want to restrict users, that each user sees only his files. How can I do this?

Because files are uploaded in folder, users may access them by browsing file urls.

View 1 Replies

Web Forms :: Get Full Permission For Dynamically Created Folder For Any User?

Feb 10, 2010

I am creating one folder like "ManageFiles" dynamically. and that time i am storing some files inside that folder.If i want to download files from that folder for some user, I am getting error.

View 1 Replies

MVC :: How To Share An Image Folder Between 2 Web Projects

Sep 22, 2010

I'm searching an answer to this question on the web for 2 weeks unsuccessfully.I'm sure I'm not the only one to wondering about that! I have two web projects MVC2: a FrontOffice and a BackOffice.

The user has to be able to upload some image in the BackOffice, which will be display on the FrontOffice and vice versa. How can I share an image folder between these two projects? Has the folder to be necessary in the solution or can it be somewhere else on the server? My team and I are working with TFS.

I want to create an image folder in which we can write and read from frontoffice and backoffice. But I don't want to have to do a "get latest version" everytime someone is adding an image in the folder. I would like to create a folder on the server we can access from the backoffice AND the frontoffice with reading and writing rights in real time. I'm not sure to be very clear.

View 9 Replies

Web Forms :: Give Write Permission To Folder For Changing The Image At Runtime

Sep 22, 2010

hw can i give write permission to folder for changing the image at runtime.i have tried so many times but still confused and free hand. can some one pls give me the solution in details.

View 4 Replies

MVC :: Put Partials Somewhere Else Except Shared Folder?

Oct 29, 2010

I have View which loads more than one partials.


It's convinient to me to divide menus for pieces. But number of partials keep growing and it is getting harder to find concrete partial in Shared folder. Can I store partials in view folder which uses this partial? Html.RenderPartial() doesn't have such parameter as Controller Name so I think that it's impossible. But if there are any solutions to solve this inconvinience?

View 2 Replies

Copyrights 2005-15, All rights reserved