Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
File writes previously in Documents Folder
like,..

System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)


-I need to write in Public Document folder ?..
Posted
Updated 9-Dec-12 23:17pm
v2
Comments
Kiran Susarla 10-Dec-12 5:25am    
Are you referring to the Outlook public folder?

i believe that it is not accessible directly.
But, there a trick-
First add an environment variable on the system with the path of public folder and then access it using-
VB
System.Environment.GetEnvironmentVariable("EnvVarName")
 
Share this answer
 
string strMyDocument = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Folder_name";


this code Accept only in 3.5 C# CommonApplicationData we can access all user ..


and


C# 4.0

System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments) + "\\Folder_name";
 
Share this answer
 
v2

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