1
sharepoint 2007에서 로컬 드라이브 programaticaly로 문서 라이브러리 문서를 복사하는 방법 누구든지이 작업을 수행 한 경우 도와주십시오.문서 라이브러리 문서를 sharepoint 2007에서 로컬 드라이브 programaticaly로 복사하는 방법
sharepoint 2007에서 로컬 드라이브 programaticaly로 문서 라이브러리 문서를 복사하는 방법 누구든지이 작업을 수행 한 경우 도와주십시오.문서 라이브러리 문서를 sharepoint 2007에서 로컬 드라이브 programaticaly로 복사하는 방법
나는 내 컴퓨터가 아니지만 이렇게하는 것이 트릭을 수행해야합니다.
using (SPSite site = new SPSite("http://sitecol"))
{
SPWeb web = site.RootWeb;
SPFolder docLib = web.GetFolder("DocLibName");
foreach (SPFile f in docLib.Files)
{
// Use RWEP when accessing local file system
SPSecurity.RunWithElevatedPrivileges(delegate(){
{
System.IO.File.WriteAllBytes(@"C:\Location\" + f.Name, f.OpenBinary());
}
}
}
기본적으로 사이트 모음을 움켜 잡은 다음 spweb 개체를 잡고 SPFolder로 문서 라이브러리를 가져옵니다. 그런 다음 해당 폴더의 모든 파일을 통해 foreach 루프를 수행하여 바이트 배열을 로컬 파일 시스템에 저장합니다.
희망이 도움이됩니다.
끝났습니다 .. 많이 감사합니다. – Rushikesh