0
A
回答
1
不是直接的,而是存在着需要StreamReader
,所以你可以做這樣的事情的ImportFile
超負荷:如果你有內容的字節數組
:
byte[] contentBytes = ... QifDom qifDom; using (Stream stream = new MemoryStream(contentBytes)) using (StreamReader reader = new StreamReader(stream)) { qifDom = QifDom.ImportFile(); }
如果您的內容爲字符串:
string content = ... byte[] contentBytes = Encoding.UTF8.GetBytes(content); QifDom qifDom; using (Stream stream = new MemoryStream(contentBytes)) using (StreamReader reader = new StreamReader(stream)) { qifDom = QifDom.ImportFile(); }
(壞API的設計,順便...參數應該是TextReader
,不StreamReader
,所以我們可以使用一個StringReader
而不是轉換字符串字節)
另外,還要注意的例子在主頁上是不正確的(沒有QifDom.Import
財產)
相關問題
- 1. 以byte []變量而不是直接本地文件路徑?
- 2. 我如何使require()採取一個文件的直接路徑
- 3. 尋路問題。不採取最直接的路徑
- 4. 包括使用直接路徑而不是相對路徑dbconfig.php文件失敗
- 5. 將變量連接到文件路徑
- 6. 從文件路徑讀取變量值
- 7. 如何在extjs中獲取文件夾路徑而不是文件路徑
- 8. 擊:變量文件路徑
- 9. 只提取文件名而不是路徑+文件名
- 10. 用FileStream直接讀取一個字節文件(不含路徑)
- 11. 「命令未找到」 採購與路徑變量文件時
- 12. PHP文件大小的直接路徑
- 13. 打開文件,而無需提供路徑直接
- 14. 採摘文件(URI到文件路徑)
- 15. 路徑變量:查找特定文件的文件夾路徑
- 16. 在awk的shell中,我可以使用變量而不是文件路徑嗎?
- 17. Eclipse:路徑變量展開爲相對而不是絕對路徑
- 18. PowerShell的路徑沒有采取字符串變量
- 19. {} project.parent.basedir採用路徑子模塊,而不是家長模塊路徑的
- 20. Xcode中 - 使用相對路徑,而不是爲框架的搜索路徑直接路徑
- 21. 無法直接從使用javascript的路徑讀取excel文件
- 22. 如何獲取資產文件夾的直接路徑
- 23. 使用變量時,而不是給整個路徑
- 24. 提示中的變量名稱而不是路徑
- 25. 從變量中批量提取路徑和文件名
- 26. 直接獲取位圖而不是fileCacheUtil中的文件
- 27. 如何讀取文本文件行變量而不是文本
- 28. 複製文件路徑等變量
- 29. 包含文件路徑的Bash變量
- 30. 將變量添加到文件路徑
哪一個是最好的,二進制或字符串輸入? – 001 2010-11-01 03:57:31
http://en.wikipedia.org/wiki/Quicken_Interchange_Format http://web.intuit.com/support/quicken/docs/d_qif.html(根據QIF規範,不使用特殊字符) – 001 2010-11-01 03:58:26