2014-09-26 7 views
2

SharePoint 작업을 실행하는 동안 네트워크 공유에서 파일을 가져 오려고합니다. 재미있는 점은 이것이 내 Dev 시스템에서 완벽하게 작동하고 Production에서 Console Application과 같이 작동하지만 동일한 네트워크 경로 및 계정 정보를 사용하여 Prod에서 작업을 실행하는 동안 파일을 가져올 수 없다는 것입니다.Directory.GetFiles가 파일을 반환하지 않습니다 ... 가끔

내가 SharePoint 2010 제품에있어
var filePath = @"Z:\"; 
var files = Directory.GetFiles(filePath, "?.gpg", SearchOption.TopDirectoryOnly); 
if (files.Length == 0) return null 

그래서 난 아무것도 그 .NET3.5을 시도 할 수 없습니다

이 코드의 간단한 조각이다. 나는 미쳐 가고있다. 어떤 아이디어? 미리 감사드립니다.

답변

0

사용이,

public DBStoreDocument(string filePath) 
    { 
     this.Load(filePath); 
    } 



string[] filePaths = Directory.GetFiles(@"" + directory, "*.gpg", SearchOption.AllDirectories); 

foreach (string path in filePaths) 
{ 
    Documenttest doc = new Documenttest(path); 

}