2017-08-14 117 views
-6

我正在使用Visual Studio 2017社區版本。我在製作C#項目時被卡住了,因爲我無法使用System.IO.Stream。未在Visual Studio 2017中找到system.io.stream

using System.Xml.Serialization; 
using System.Runtime.Serialization.Formatters.Binary; 
using System.IO.Stream; 

Here is what it shows

+0

'System.IO.Stream',在'Stream'中有一個大寫'S'。 請在將來的實際問題中包含代碼,而不是代碼的屏幕快照。 –

+0

我甚至用了大寫'S',但它也不起作用。無論如何,我添加了一個新的圖片顯示錯誤。另外,感謝您的建議,我添加了有問題的代碼。 –

回答

-1

C#是區分大小寫的,命名空間是System.IO.Stream

你也將需要包括使用語句內static作爲流是一類

using static System.IO.Stream; 
+0

'使用靜態'出現在C#6(2015年7月發佈) - https://gooroo.io/GoorooTHINK/Article/16282/C6-New-Features/18096#.WZIvvlGGPZQ –

+0

非常感謝。 –

3

的命名空間實際上是System.IO System.IO替換System.IO.Stream 流i是一個類,不是命名空間

+0

這在2017年對我有效 – iangolden

相關問題