GetString() 공개 메소드

Retrieves a string of the tox key.
public GetString ( ) : string
리턴 string
예제 #1
0
        public bool Delete(ToxKey publicKey)
        {
            string avatarFilename = Path.Combine(Dir, publicKey.GetString() + ".png");
            if (File.Exists(avatarFilename))
            {
                try { File.Delete(avatarFilename); }
                catch { return false; }

                return true;
            }
            else
            {
                return false;
            }
        }
예제 #2
0
        private byte[] LoadBytes(ToxKey publicKey)
        {
            try
            {
                string avatarFilename = Path.Combine(Dir, publicKey.GetString() + ".png");
                if (File.Exists(avatarFilename))
                {
                    byte[] bytes = File.ReadAllBytes(avatarFilename);
                    if (bytes.Length > 0)
                        return bytes;
                }

                return null;
            }
            catch { return null; }
        }
예제 #3
0
 public bool Save(byte[] img, ToxKey publicKey)
 {
     try
     {
         File.WriteAllBytes(Path.Combine(Dir, publicKey.GetString() + ".png"), img);
         return true;
     }
     catch { return false; }
 }
예제 #4
0
 public bool Contains(ToxKey publicKey)
 {
     return File.Exists(Path.Combine(Dir, publicKey.GetString() + ".png"));
 }