Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# AutoCAD
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.)
 
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 10-Dec-11 23:47pm
Edited 12-Dec-11 0:03am
v3

1 solution

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

Solution 1

If filepath is a variable then you should remove the quotes around it:
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.
  Permalink  
Comments
Wonde Tadesse at 11-Dec-11 16:59pm
   
5+
Mehdi Gholam at 11-Dec-11 17:02pm
   
Thanks
phoenix1167 at 12-Dec-11 3:01am
   
Thanks, but how can i map my path.the path is \\ServerName\SharedFolderName\ProtectedFolder\file.dwg
Mehdi Gholam at 12-Dec-11 9:00am
   
net.exe map p: \\servername\sharedfoldername
phoenix1167 at 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?
Mehdi Gholam at 13-Dec-11 1:24am
   
My appologies, net use p: \\...
phoenix1167 at 13-Dec-11 1:39am
   
I have received previous message again...?
Abhinav S at 12-Dec-11 5:20am
   
Exactly. 5.
Mehdi Gholam at 12-Dec-11 8:59am
   
Thanks

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

  Print Answers RSS
0 OriginalGriff 315
1 Jochen Arndt 190
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 12 Dec 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