2013-05-17 30 views
1

我在安裝Net Framework 4.5的Windows 8中使用Microsoft Visual Studio 2012。
我似乎無法在UTF8Encoding類中找到getString(Byte [])方法。
由於在msdn documentation中提供了兩種方法,所以我不確定我缺少什麼。
的方法:GetString的在UTF8Encoding類
我的微軟C#代碼C#UTF8Encoding getString(Byte [])方法未出現

using System.Text; 

// the code which I use the GetString method 
// characters is a byte array 


UTF8Encoding utfEncode= new UTF8Encoding(); 
string encodedStr= utfEncode.GetString(characters, 0, characters.Length); //this method is available to me 
string encodedStr= utfEncode.GetString(characters); // the error message was that no such overloading method is found 
+0

什麼類型的人物對象? –

+0

正在做XNA或便攜式應用程序?如果那麼只有第一種方法可用 – Damith

+0

你可以用utfEncode.GetString編譯你的代碼嗎? – Adamy

回答

1

AS MSDN文檔不適用於便攜式類庫和XNA應用GetString一個參數。你必須使用第二個過載有3個參數

enter image description here

+1

並且您將如何在此場景中使用3個參數的此方法? – zuckerthoben