Esempio n. 1
0
        public static bool AddMD5Sum(string _filePath)
        {
            MD5Dictionary instance = GetInstance();

            if (instance == null)
            {
                return(false);
            }

            lock (instance)
            {
                return(instance.AddFromFile(_filePath));
            }
        }
Esempio n. 2
0
        public static void RemoveMD5Sum(string _filePath)
        {
            MD5Dictionary instance = GetInstance();

            if (instance == null)
            {
                return;
            }

            lock (instance)
            {
                instance.Remove(_filePath);
            }
        }
Esempio n. 3
0
        public static MD5Dictionary InitInstance(string _dictionaryPath)
        {
            if (_dictionaryPath == null)
            {
                _dictionaryPath = "md5sum";
            }
            if (Instance == null)
            {
                Instance = new MD5Dictionary();
            }

            Instance.Clear();
            Instance.mWorkingDictionary = _dictionaryPath;
            Instance.mFilePath          = Path.Combine(Instance.mWorkingDictionary, FILE_NAME);
            Instance.Load();
            Instance.mMD5 = System.Security.Cryptography.MD5.Create();

            return(Instance);
        }