Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: IIS7 C# RemoteControl
I have a web application in c#, creating a csv file in the directory "\\\\10.90.233.203\\mps\\dialcodes.csv" and I used it just like the following :
 
System.IO.StreamWriter StreamWriter1 =
new System.IO.StreamWriter(@"\\\\10.90.233.203\\mps\\dialcodes.csv", false, Encoding.Default);
 

The code works well when I run it from my localhost; but when I put my code on IIS server the following error appears :
 
Access to the path \\10.90.233.203\mps\dialcodes.csv; is denied
 

I think the reason for that is related to user authorization. I used network service for my application pool.Besides, in the server in which my folder mps exits I do all af the security authorization. I give full control for network service in my mps folder.But nothing changed, the same error appears.
Posted 18-Mar-11 4:41am
shylsn492
Edited 20-Mar-11 8:06am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try putting the file into your web site's virtual directory somewhere.
  Permalink  
Comments
Sandeep Mewara at 18-Mar-11 13:41pm
   
Comment from OP:
You are rigt but, I have to put the file in the directory where my database exists becase after creating the file in that directory I will execute bulk insert function. If the file is not in the same directory with my database bulk insert function does not work!
shylsn at 19-Mar-11 19:07pm
   
Unfortunatelly I have to put the file in remote content, but I do not how how to get authorization for read/write a emote file from IIS

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



Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 20 Mar 2011
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