하는이 시도 :이 대상 웹 서버는 물론 구성 방법에 따라 달라집니다
using (SPSite site = new SPSite("http://fsm/Lists/sample/AllItems.aspx"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["sample"];
SPListItemCollection items = list.GetItems(new SPQuery());
foreach (SPListItem item in items)
{
foreach (string attachment in item.Attachments)
{
// "http://fsm" + "Lists/sample/1_.000"
Uri itemAddress = new Uri(new Uri(web.Url), item.Url);
Uri attachmentAddress = new Uri(itemAddress,
String.Format("Attachments/{0}/{1}", item.ID, attachment));
SPFile file = web.GetFile(attachmentAddress.AbsoluteUri);
Console.WriteLine("{0} have {1} bytes", file.Name, file.Length);
}
}
}
}
, 당신은 여기에 대한 세부 사항을 포함하지 않았다. 검색 대상 웹 서버와 파일 시스템을 제어하는 경우이 작업을 수행하는 더 쉬운 방법이 있습니다. –