SORU
27 Temmuz 2011, ÇARŞAMBA


Okuma dize içerik dosyası .Net Kompakt Çerçeve

İle mobil cihazlar için bir uygulama geliştiriyorum .net kompakt çerçeve 2.0. Bir string nesnesi için bir dosyanın içeriğini yüklemek için çalışıyorum, ama bir şekilde bu işi yapamam. System.IO.StreamReader Sınıf ReadToEnd() yöntem yoktur. Bu işlevselliği sağlayan başka bir sınıf var mı?

CEVAP
27 Temmuz 2011, ÇARŞAMBA


StringBuilder sb = new StringBuilder();
using (StreamReader sr = new StreamReader("TestFile.txt")) 
{
    String line;
    // Read and display lines from the file until the end of 
    // the file is reached.
    while ((line = sr.ReadLine()) != null) 
    {
        sb.AppendLine(line);
    }
}
string allines = sb.ToString();

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • 24 Канал

    24 Кана�

    5 ŞUBAT 2006
  • Associated Press

    Associated P

    18 EYLÜL 2006
  • Excel Functions

    Excel Functi

    4 NİSAN 2010