chuck
chuck

Reputation: 141

Cannot access shared folder programatically in sharepoint

I'm trying to display shared folder contents in doc library fashion in sharepoint 2007. I am able to get files from local dir c:\Test but not from shared folder.

I am using below code to check:

if (Directory.Exists(@"\\servername\foldername\"))

If I try same code in .net application on same sharepoint server it is detecting the shared folder but no luck with sharepoint code

it says folder doesn't exist and we are using IIS anonymous with CA Siteminder authentication

any ideas are greatly appreciated!

Upvotes: 0

Views: 1075

Answers (2)

Contributor
Contributor

Reputation: 1

try with Page Viewer Web Part. It's easy to follow the process.

Upvotes: -1

Sam B
Sam B

Reputation: 2481

Make sure the IIS application pool of your sharepoint site is configured with a domain account; and make sure this account have sufficient rights on the shared folder.

If your app pool is using a local account, you will need to impersonate using LogonUser (advapi32.dll).

Upvotes: 2

Related Questions