.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Folder Permissions in Windows7 using C# code and window forms

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF

I want to give full control or write permissions to the folder in program files folder in windows 7 OS using c# code for any user.

Ex: C:/Program files/ABC/XYZ

I want to give full control permissions to XYZ folder for all users in that system when my application is accessed.

Pls help me Its an urgent requirement in my project.

Thanks in Advance

View Complete Post

More Related Resource Links

Browser window is opening up on the second click with javascript code



I am trying to set a javascript code to open up a new browser window with this URL that exists like shown below.

On the first click nothing happens but on the second click the browser window is opening up.


How is it possible to make it open up on the first click ?

                                <asp:ImageButton ID="ImageButton3" runat="server" Height="84px" 
                                    ImageUrl="~/images/1.jpg" Width="165px" 
                                    onclick="ImageButton3_Click" />

    protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        String openURL = "javascript:window.open('" + "Folder1/testing.aspx" + "');return false;";
        ImageButton3.OnClientClick = openURL;


Access denied to folder in ASP.NET project either though I have granted all users full permissions !



i have made a very simple file upload app, that i want users to be able to upload images to a folder on my server, well localhost for the time being Stick out tongue

here is the simple upload code...

        protected void ButtonRegisterDetails_Click(object sender, EventArgs e) 
            // display properties of the uploaded file 

Background window failed to update after MessageBox was closed on 64-bit Windows7

In vs2008, I open a WPF window as background, and then click a button in background window to open the second window. In the second window, I make it WindowStartupLocation CenterScreen and put some controls, and then click a button in the second window to close it and open a messagebox, after closing the messagebox, I find the area behind the messagebox always fails to update in the background window. code of the buttonclick from the second window: this.close(); messagebox.show("*********************")  // after closing the messagebox, the area behind it in the backgound window always fails to update. This issue can only be reproduced in 64-bit windows7 Anyone got idea? Thanks in advance. bruce

Permissions issue for custom web service in the _vti_bin folder.

Hello, I have created a custom ASMX webservice that returns in JSON format so that I can call the data from JQuery on SharePoint page content.  I placed it in the ISAPI (_vti_bin) folder and it works just fine when I go directly to the web service and call it the way JQuery calls it: /_vti_bin/ServiceabilityCheck.asmx/GetSystemIDByZIPCode?ipaddress= Which returns: <string>{"SystemID":"5"}</string> When I try to call it from the SharePoint site with JQuery, it errors out and gives an unspecified error.  Fiddler shows {"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException"} as the response from the web service call. When I have the webservice on an IIS web app outside of SharePoint, it works fine.  I have anonymous access enabled on the SharePoint site, why would it give me this error?John Chapman | Blog: http://www.johnchapman.name

Copy sharepoint 2007 folder (with sub folders) with all the security permissions

I am looking to copy a common sharepoint folder(sub folders) in 2007 with all the security permissions intact, to a different location in the same site, Does anyone know how to do this?

Minimum Permissions Needed To See Cdc tables In System Tables Folder

What are the minimum permissions needed for a user to see the cdc tables in the System Tables folder in SQL Management Studio?DJ Baby Anne's Biggest Fan................

Copy sharepoint 2007 folder (with sub folders) with all the security permissions

I am looking to copy a common sharepoint folder(sub folders) in 2007 with all the security permissions intact, to a different location in the same site, Does anyone know how to do this?

Accessing code in InfoPath 2003 forms from Visual Studio 2005

Can vbscript code contained in an InfoPath 2003 form be accessed from VS2005 on a machine running Office 2010? We are testing Office 2010 our our PC's and the custom task pane code that works just fine on PC's running Office/InfoPath 2007 does not run on the test PC's. I've been reading that the vbscript code in the form can't be edited directly when opening the form in InfoPath 2010, but that's not what I'm trying to do. I want to access the vbscript code through the .Extension property of the XDocument object from client side javascript code on an .aspx page like we have done for years. The existing code, which runs perfectly on PC's with Office/InfoPath 2007,  looks like this ... var xDoc = window.external.Window.XDocument; xDoc.Extension.UserLookupDone (userid); When run on PC's with Office/InfoPath 2010 the code throws error "Class doesn't support Automation". Are we trying something that is no longer possible? Any help is appreciated.

New to Sharepoint companyweb and deleted all folder permissions by mistake

Hello.  I am just delving into the world of Sharepoint and testing to see if it will help our company meet it's needs for accessing files remotely as well as giving us collaberation abilities we currently don't have.  We recently purchased a new Windows 2008 Small Business Server which includes Sharepoint 3.0 and I've been messing around with the companyweb page.  My current goal is to emulate how we are using network drives.  There is a drive for each department and then a shared drive where common files for eveyrone are stored.  Rights are maintained using security groups. In the companyweb, inside the Document's section I created a new library named "Department Files" then within that created folders for Accounting, Customer Service, HR etc.  Being completely new to Sharepoint I was editing the permissions to the Accounting folder but forgot to add the domain administrator before deleting the existing rights.  Now the folder is no longer visible and I can't figure out how to edit the rights to it. The permissions that were removed were: CompanyWeb Members, CompanyWeb Owners, and CompanyWeb Visitors. Where can I go to see this hidden directory and change/restore the permissions?  Since this is all testing stuff I can also delete it and start again.  There isn't any info that I need to worry about retaining at thi

Alternative solution to folder level permissions

I have a document library with multiple levels of folders that group sets of documents. Each folder has unique permissions setup. Ran into issue with URL length limitation because of multiple levels. I am looking at an alternative solution using meta data columns and views to categorize data. Everything is fine except I am not sure how to implement security akin to permissions on folder. How would I implement security based on meta data columns ? One soution that I can think of is creating workflows using SPD. Are there any other solutions for this ?

Create report that lists every user with permissions for each folder

I would like to have a report that will list each user with it's roles for every folder. We have a very large RS database with a lot of folders, we need some better way to keep track of permissions. I created a report that utilizes "GetPolicies" from http://localhost/reportserver/ReportService2005.asmx but I have to feed a folder name to get list of users. I can also (by using subreport) list all folders with users. However, I am not able to produce a report where I have it broken by user. any idea?

Open browser window + populate from code behind

Hi,I have a variable, which contains a whole web page. Is there a way to open a new browser window and set the contents of this variable as the page? I don't mind if it's javascript, but it has to be able to hold a bit of data if this is the case.Thanks!

Open popup window with js and .net code

I did a little research and all i can find is binding the js to a control that will fire the popup.Is there a way that i can use in code so i can trigger a popup window from vb.net code?Thanks.P.S. If it is to complicated then is there a way to have a button set with the popup message i want the user to view and make the button click with .net code so the onclick event will fire and show the popup window?

Launch window forms app from windows service

I have a windows forms app that is used to manage settings for a windows service. When the service starts I want to launch the forms app. I'm using Process.Start("myWindowsApp") and I can see the app running in the task manager processes but the windows aren't displayed. My guess is that it's because the service is running under the localsystem account but what do I need to do to make the windows forms app work properly? SteveR

set or remove permissions of the folder


hi forum

Is it possible to set or remove permissions(read, write,delete)  of any Existing folder using c#. if yes then how we can do ???


thanking you in advance

Can we managed code for a list using InfoPath forms?


Is possible to add manage code to Infopath LIST forms. We want to validate data that goes beyond what InfoPath can do out of  the box.

Folder and document specific permissions

My problem is that when I grant a user Read/Contribute permission to a document which is located in a folder in a library where I have not granted access to the user before. When the user is granted a Read/Contribute permission to the document the system creates a restricted permission to the library and to the folder where the document exists. But the problem is that the user can't access the file throught browser or Sharepoint Workspace. User can view the library but do not see the folder where the document is and in SharePoint Workspace the file is visible when syncing but the path to the file is wrong. Allthough user can find and access the file using a fileID.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend