1
A
回答
1
任務1:獲取圖片庫的名單在指定網站上
public static XmlNode GetPicLibListingXML(string imagingServiceURL)
{
Imaging wsImaging = new Imaging();
wsImaging.UseDefaultCredentials = true;
wsImaging.Url = imagingServiceURL;
XmlNode xnPicLibs = wsImaging.ListPictureLibrary();
return xnPicLibs;
}
採樣返回XML:
<Library name="{3C1D52F5-5387-490A-9A2D-A9C99A208C00}" title="Tech Images" guid="3c1d52f5-5387-490a-9a2d-a9c99a208c00" url="Tech Images" xmlns="http://schemas.microsoft.com/sharepoint/soap/ois/" />
任務2:清單在一個給定的庫圖片
public static XmlNode GetImageFileListing(string imagingServiceURL, string imageFileLibraryName)
{
Imaging wsImaging = new Imaging();
ImageInfo curImageInfo = new ImageInfo();
wsImaging.UseDefaultCredentials = true;
wsImaging.Url = imagingServiceURL;
XmlNode xnListItems = wsImaging.GetListItems(imageFileLibraryName, "");
return xnListItems;
}
任務3:下載圖片
private const string ATTR_FILENAME = "name";
private const string FILENAMESPACEURI = "http://schemas.microsoft.com/sharepoint/soap/ois/";
public static bool DownloadImageFiles(string imagingServiceURL, string imageFileLibraryName, string[] fileNames, string saveToFolder)
{
Imaging wsImaging = new Imaging();
wsImaging.UseDefaultCredentials = true;
wsImaging.Url = imagingServiceURL;
XmlElement parent = (XmlElement)wsImaging.Download(imageFileLibraryName, string.Empty, fileNames, 0, true);
XmlNodeList files = parent.GetElementsByTagName("File", FILENAMESPACEURI);
foreach (XmlNode file in files)
{
if (Directory.Exists(saveToFolder) == false)
{
Directory.CreateDirectory(saveToFolder);
}
byte[] fileBytes = Convert.FromBase64String(file.InnerText);
using (FileStream fs = File.OpenWrite(saveToFolder + file.Attributes[ATTR_FILENAME].Value))
{
BinaryWriter writer = new BinaryWriter(fs);
writer.Write(fileBytes);
writer.Close();
}
}
return true;
}
注:
- 成像()類的Web引用imagining.asmx
- 的下載調用本地返回XML這樣喲Uneed公司通過轉換運行它,如果你需要字節
- 獲得MSDN上就出在想象Web服務檢查的引用這樣的:
http://msdn.microsoft.com/en-us/library/imaging.imaging.aspx
來源:
相關問題
- 1. 從c#winforms中的數據庫檢索圖像到圖片框
- 2. 如何從圖片框中的Sql數據庫檢索圖像
- 3. 無法檢索圖像從數據庫到圖片框
- 4. Javascript/Ajax圖片庫/檢索
- 5. 從數據庫中檢索圖像
- 6. 如何從數據庫檢索圖像?
- 7. 從mvc.net的數據庫檢索圖像
- 8. 從sql數據庫檢索圖像
- 9. PHP從數據庫檢索新圖像
- 10. 從SQL Server數據庫檢索圖像
- 11. 從Oracle數據庫檢索圖像
- 12. 從訪問數據庫檢索圖像
- 13. 從數據庫檢索圖像ASP.NET MVC
- 14. 從數據庫插入/檢索圖像
- 15. 從url中檢索圖片
- 16. 如何檢索圖像從數據庫路徑和顯示圖像路徑縮略圖像照片庫在iphone
- 17. 檢索圖像iphone庫
- 18. 檢索圖片
- 19. 顯示從數據庫檢索圖像到圖像控制
- 20. 從數據庫檢索圖像到圖像標記
- 21. 圖像庫和從服務器檢索圖像
- 22. 如何從數據庫檢索圖像到循環中的4個圖片框
- 23. 如何使用ImageConverter將圖像從數據庫檢索到圖片框?
- 24. 如何檢索圖像從數據庫到c中的圖片框#
- 25. 從圖片數組中檢索圖像屬性
- 26. 如何從圖庫中檢索圖片的Picasa ID/URL
- 27. 從Parse中檢索圖像
- 28. 從鏈接檢索圖像
- 29. 從NSData中檢索圖像
- 30. 從窗口檢索圖像
感謝Tjassens - 你能提供的內容? – Spt2432
這裏你去spt :) – Tjassens
謝謝一堆。我明天會嘗試這個,但看起來像我在找什麼。 – Spt2432