Thursday, January 6, 2011

how to run line by line in text file - on windows mobile ?

Programmer Question

hi



in WinForm on PC i use to run like this:



FileStream FS = null;
StreamWriter SW = null;
FS = new FileStream(@"\Items.txt", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
SW = new StreamWriter(FS, Encoding.Default);
while (SW.Peek() != -1)
{
TEMP = (SW.ReadLine());
}


but when i try this on Windows-mobile i get error:



Error   1   'System.IO.StreamWriter' does not contain a definition for 'Peek' and no extension method 'Peek' accepting a first argument of type 'System.IO.StreamWriter' could be found (are you missing a using directive or an assembly reference?)
Error 2 'System.IO.StreamWriter' does not contain a definition for 'ReadLine' and no extension method 'ReadLine' accepting a first argument of type 'System.IO.StreamWriter' could be found (are you missing a using directive or an assembly reference?)


how to do it ?



thanks



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails