Demo entry 6655168

1

   

Submitted by anonymous on Oct 26, 2017 at 07:36
Language: C#. Code size: 1.1 kB.

public override bool Load()
        {
            IsLoaded = false;

            String path = GetExternalPath();
            if (!File.Exists(path))
                return false;

            string[] readfile;
            using (FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read))
            {
                using (StreamReader sr = new StreamReader(file))
                {
                    readfile = new string[File.ReadAllLines(path).Length];
                    String line;
                    int t = 0;

                    while ((line = sr.ReadLine()) != null)
                    {
                        readfile[t] = line;
                        t += 1;
                    }

                }
            }

            _readData = Utility.ConvertStringArrayToString(readfile);

#if SAVEDATA_ENCODING
            _readData = GSB2Crypt.AESDecrypt(filedata, _password);
#endif

            if (_readData.Length == 0)
                return false;

            IsLoaded = true;  

            return true;
        }

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).