Click here to Skip to main content
15,868,292 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 20-Mar-11 7:06am
v3

1 solution

Try putting the file into your web site's virtual directory somewhere.
 
Share this answer
 
Comments
Sandeep Mewara 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 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900