Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
I want to open a folder on the server where my application is hosted. the same is opened at the design time, but when the application is published it generates an error saying access is denied from the client machine. i am using the following code for opening the desired folder in the webserver
protected void LinkButton5_Click(object sender, EventArgs e)
    {
            string myPath = ("D:\\myfolder\\addresses");
            Process prc = new Process();
            prc.StartInfo.FileName = myPath;
            prc.Start();
     


}
 

please can anyone help me. how to resolve the issue. do i need to assign permissions to the folder. I am using windows 7OS and IIS7 services and has written the code in asp.net/c#
 
thanks in advance
Posted 21-Dec-12 19:31pm
Edited 21-Dec-12 19:33pm
v2
Comments
Shahin Khorshidnia at 22-Dec-12 2:09am
   
Did you check the path if it exists? If yes, have you checked the permissions?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Well, the error says access is denied! Surely, one of the access permissions are missing. Checked for ASPNET user? Try impersonation and see if it works?
 
Refer my answer to similar question: Access to the path denied.. Pls help...[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

i have granted full control to IIS_user and network services . but then also the same error exists. I am not aware of impersonation techniques. can u please help me with some sample code.
thanks in advance
  Permalink  
Comments
Krunal Rohit at 23-Dec-12 0:16am
   
post it as comment on particular solution.. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 375
1 Prakriti Goyal 242
2 Yogesh Kumar Tyagi 224
3 Sergey Alexandrovich Kryukov 158
4 CPallini 150
0 OriginalGriff 6,742
1 Sergey Alexandrovich Kryukov 5,479
2 Maciej Los 3,474
3 Peter Leow 3,313
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100