|
пример из книги inside . у меня эксепшн.
|
|||
---|---|---|---|
#18+
привет ! пример из inside sharepoint . работа с билбиотекой. почему ошибка ? код : Код: c# 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38.
Код: c# 1.
на эту строчку ругатеся . пишет : Exception kjh Ошибка ввода-вывода.::: в Microsoft.SharePoint.SPFileCollection.AddStreamOrBytesInternal(String urlOfFile, Stream file, PutFileOpt fileOpt, String createdBy, String modifiedBy, Int32 createdByID, Int32 modifiedByID, DateTime timeCreated, DateTime timeLastModified, Object varProperties, String checkInComment, Stream formatMetadata, String lockIdMatch, String etagToMatch, SPLockType lockType, String lockId, TimeSpan lockTimeout, Boolean validateRequiredFields, SPVirusCheckStatus& virusCheckStatus, String& virusCheckMessage, String& etagNew, Boolean& ignoredRequiredProps) в Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Stream file, Boolean overwrite, String checkInComment, Boolean checkRequiredFields) в Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Stream file, Boolean overwrite) в ConsoleApplicationLibrary.Program.Main(String[] args) wer спасибо ! ... |
|||
:
Нравится:
Не нравится:
|
|||
23.07.2012, 16:25 |
|
пример из книги inside . у меня эксепшн.
|
|||
---|---|---|---|
#18+
SPSite MySite = new SPSite(" http://Localhost/Deps/sup"); SPWeb web = MySite.OpenWeb(); SPDocumentLibrary library = (SPDocumentLibrary)web.Lists["Общие документы"]; //write text-based content into memory stream using( MemoryStream DocumentSream = new MemoryStream()) using (StreamWriter writer = new StreamWriter(DocumentSream)) { writer.WriteLine(string.Format(" {0}; {1};{2}", MyTemp, "test", "testestest")); //writer.Close(); writer.Flush(); library.RootFolder.Files.Add("document.csv", DocumentSream, true); DocumentSream.Dispose(); } а как сделать дозапись файла, вместо перезаписи ? дозапись можно построить так : Код: c# 1. 2. 3. 4.
а как это применить к моему примеру ? спасибо ! ... |
|||
:
Нравится:
Не нравится:
|
|||
24.07.2012, 12:00 |
|
|
start [/forum/topic.php?fid=12&fpage=16&tid=1330428]: |
0ms |
get settings: |
7ms |
get forum list: |
11ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
27ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
34ms |
get tp. blocked users: |
1ms |
others: | 283ms |
total: | 382ms |
0 / 0 |