// This work on my case ^ _^ y
// E.G: string[] m_TextLines = ReadAllTextLinesFromFile( “Content/TextData/l1.dat” , true );
/// <summary>
/// Read all text lines in a text file and returns an array of strings.
/// </summary>
/// <param name="filePath">File path to read.</param>
/// <returns>Returns an array of strings.</returns>
public static string[] ReadAllTextLinesFromFile(string filePath, bool IsAndroid )
{
string[] m_Result = null;
if ( IsAndroid )
{
using (SIO.Stream m_FS = XF.TitleContainer.OpenStream(filePath))
{
using (SIO.StreamReader m_SR = new SIO.StreamReader(m_FS))
{
var m_TextList = new SCG.List<string>();
//
while (!m_SR.EndOfStream) m_TextList.Add(m_SR.ReadLine());
//
m_Result = m_TextList.ToArray();
//
m_TextList = null;
}
}
}
else// Windows
{
m_Result = SIO.File.ReadAllLines(filePath);
}
return m_Result;
}