c# end of file

lilachila

New member
c# end of file

איך ניתן לבדוק בשפת c# שהגענתי לסוף הקובץ? תודה מראש
 

itzikbs

New member
System.IO

איך אתה קורא ? באמצעות מחלקת File או StreamReader או FileStream ? יש כל כך הרבה דרכים ... יש לך MSDN ? נסה ככה (מצטער על העימוד לא עובד לי ) או בלינק : http://msdn2.microsoft.com/en-gb/library/6ka1wd3w.aspx: using System; using System.IO; class Test { public static void Main() { // Create an instance of StreamWriter to write text to a file. // The using statement also closes the StreamWriter. using (StreamWriter sw = new StreamWriter("TestFile.txt")) { // Add some text to the file. sw.Write("This is the "); sw.WriteLine("header for the file."); sw.WriteLine("-------------------"); // Arbitrary objects can also be written to the file. sw.Write("The date is: "); sw.WriteLine(DateTime.Now); } } }
 
למעלה