Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have saved encrypted text as string variable...i wanna to save those variable as text file in my local disk in asp.net....i try to write text file but getting this error"c:/cloud/file.txt -not a virtual path"
Posted
Updated 27-Feb-13 19:24pm
v2
Comments
Sergey Alexandrovich Kryukov 28-Feb-13 1:29am    
Why?!
—SA
bbirajdar 28-Feb-13 1:45am    
show your code

1 solution

There are no situations when hard-coding any path names in the application can be useful. In all programming, in general. Now, as to ASP.NET or any other server-side HTTP server technology, this is especially bad thing: the Web applications are executed in such a sandboxed environment where it is impossible to access any files beyond the sub-directory representing the site's root. You simply won't get permissions for doing so. For some very good reasons.

—SA
 
Share this answer
 
Comments
Deenuji 28-Feb-13 4:02am    
thank u sir...i want to ask one more question sir???
Sergey Alexandrovich Kryukov 28-Feb-13 11:26am    
Oh, sure. If it is related, ask right here by a comment, if not, you are always welcome to ask a new one. If you want to notify me, also write your comment here and give a link to this question. If I can answer, I will.
—SA
Espen Harlinn 28-Feb-13 8:18am    
Good points, permissions are certainly required :-D
Sergey Alexandrovich Kryukov 28-Feb-13 11:27am    
Which won't be granted anyway, if this is some absolute path outside the site's root directory... :-)
Thank you, Espen.
—SA

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