예제 #1
0
 private static void DeleteAccountFileOnApplieDevice()
 {
     if (GlobalManager.ClientType == 2)
     {
         string accountFilePath = FileIOHelper.GetAccountFilePath();
         Log.debug("@@@@ DeleteAccountFileOnApplieDevice");
         if (File.Exists(accountFilePath))
         {
             Log.debug("@@@ begin to delete file!");
             File.Delete(accountFilePath);
         }
     }
 }
예제 #2
0
 private static void PutAccountContentToAppleDevice(string content)
 {
     if (GlobalManager.ClientType == 2)
     {
         string accountFilePath = FileIOHelper.GetAccountFilePath();
         if (File.Exists(accountFilePath))
         {
             File.Delete(accountFilePath);
         }
         FileStream fileStream = new FileStream(accountFilePath, FileMode.Create);
         byte[]     bytes      = new UTF8Encoding(true).GetBytes(content);
         fileStream.Write(bytes, 0, bytes.Length);
         fileStream.Close();
     }
 }
예제 #3
0
        private static string GetAccountContentFromAppleDevice()
        {
            string text = string.Empty;
            string result;

            if (GlobalManager.ClientType == 2)
            {
                string accountFilePath = FileIOHelper.GetAccountFilePath();
                if (!File.Exists(accountFilePath))
                {
                    result = text;
                    return(result);
                }
                FileStream   fileStream   = new FileStream(accountFilePath, FileMode.OpenOrCreate, FileAccess.Read);
                BinaryReader binaryReader = new BinaryReader(fileStream);
                int          num          = (int)fileStream.Length;
                byte[]       array        = new byte[num];
                binaryReader.Read(array, 0, array.Length);
                text = Encoding.Default.GetString(array);
                fileStream.Close();
            }
            result = text;
            return(result);
        }