473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# vista does not giving access to create folder

6 New Member
In my project I have to create some files and directories into my app folder which is into program files. But in vista it is giving me error that I dont have access to create file. What should I do now for giving access ? Also it not let me access the registry !!
Sep 25 '10 #1
1 1963
Subin Ninan
91 New Member
Embed an application manifest within your program with "requireAdministrator" attribute.

Edit "Secure Folder" with your ProjectName in following manifest file.
Save it as "YourAppName.exe.manifest" in your project directory.
To embed this manifest in VS 2008 go to:
Project Properties > "Application" tab > in "Manifest" comboBox select this manifest file.
(if this manifest file is not shown in this comboBox, open solution explorer and right-click on this manifest file and select "Include in project".

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  3. <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  4.   <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="SecureFolder" type="win32" />
  5.   <description>SecureFolder</description>
  6.   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
  7.     <security>
  8.       <requestedPrivileges>
  9.         <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
  10.       </requestedPrivileges>
  11.       <applicationRequestMinimum>
  12.         <defaultAssemblyRequest permissionSetReference="Custom" />
  13.         <PermissionSet class="System.Security.PermissionSet" version="1.3" Unrestricted="true" ID="Custom" SameSite="site" />
  14.       </applicationRequestMinimum>
  15.     </security>
  16.   </trustInfo>
  17. </assembly>
  18.  
  19.  

You need to have administrative rights to edit registry.
Sep 25 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: sajithm | last post by:
Hi all, I have a problem while trying to create folder and files in a remot storage server using asp.net. Actually I was trying with filesystem object and this says bad usernam and passeord,....
0
by: TomislaW | last post by:
I have windows service that need to access folder on our domain, but windows service runs with user that does not have rights to access that folder. I need to use different username and password...
2
by: Tim Tyteca | last post by:
Hello, I'm creating a poll using javascript and FSO to alter the xml file that keeps the vote count. If I run the script locally it works fine, but when I try to run it from a netware folder it...
1
by: deepaks85 | last post by:
Dear Sir, I have written a php script to create folder : <?php $targetpath = $_SERVER . "/reports/"; $target = $targetpath . basename( $_FILES); mkdir($targetpath.$vName,0700); ?>
0
by: ColdCoffee | last post by:
Scenario: My computer: name : PrasComp pass : Pras123 Domain : XYZ Computer I wanna access: Name : AnoComp pass : #Pras
0
by: ftech | last post by:
Hi, I have to upload files from a client folder to the server. The user may select any folder and the folder may contain any number of files. I provide the users with a text box to enter the...
0
by: mrinalaryan | last post by:
create folder & upload file in the web server through web service-C# -------------------------------------------------------------------------------- im using web service to connect windows form...
1
by: vamsioracle | last post by:
hi can any one help me to get the logic for this. The code should automatically access a folder from local system and the files should be added to zip folder and stored in the local system...
2
by: Noorain | last post by:
sir how to create folder to use php script? i know how to file upload in folder to use php. but i can't how to create folder. i type name & its create my folder. Example: Type: test. my...
3
by: samvb | last post by:
Hi, I have a folder within my root website (cant move it out cos of restrictions). I have placed htaccess file in it which works just fine. It displays the usual log in box when someone tries to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.