Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to open an autocad file on a shared folder but it fails with comexception saying file was not found, but file exists. Here's the code: ("filePath" is the path to the file and acApp is a reference to Autocad object.)

C#
if(File.Exists(filePath))
{
    acApp.Documents.Open(filePath);
}


note: i have denied all users access to my shared folder and just one user can open or modify this folder and its sub files.i have logged on this user before trying to open my dwg file.
Posted
Updated 11-Dec-11 23:03pm
v3

1 solution

If filepath is a variable then you should remove the quotes around it:
C#
if(File.Exists(filePath))
{
    acApp.Documents.Open(filePath);
}


If not then try mapping the share folder to a drive name instead of using the \\computername\sharefolder syntax.
 
Share this answer
 
Comments
Wonde Tadesse 11-Dec-11 16:59pm    
5+
Mehdi Gholam 11-Dec-11 17:02pm    
Thanks
M_Mogharrabi 12-Dec-11 3:01am    
Thanks, but how can i map my path.the path is \\ServerName\SharedFolderName\ProtectedFolder\file.dwg
Mehdi Gholam 12-Dec-11 9:00am    
net.exe map p: \\servername\sharedfoldername
M_Mogharrabi 13-Dec-11 0:30am    
Thanks, i have tried net.exe map p: \\servername\sharedfolder
but i have received this message :
"the syntax of this command is: NET [ACCOUNT | COMPUTER | CONFIG |...]".

i have tried net use instead of net.exe but i received a message like the above.

i have tried "net use \\servername\sharedfolder" finally however received this message : "The command completed successfully".but what does it mean?how can i get the map of my path?

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