/// <summary>
        /// 从"独立存贮空间"取程序第一次运行的时间并解密
        /// </summary>
        /// <returns></returns>
        public static string GetDataTime()
        {
            string fromDataTime;

            //按用户、域、程序集获取独立存储区
            IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User
                                                                        | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, null, null);

            string[] myusername = isoStore.GetDirectoryNames(UIConstants.IsolatedStorageDirectoryName);
            if (myusername.Length == 0) //没有文件夹
            {
                return(string.Empty);   //域中没有他的目录
            }

            myusername = isoStore.GetFileNames(UIConstants.IsolatedStorage);
            if (myusername.Length == 0) //没有文件
            {
                return(string.Empty);   //域中没有他的用户名
            }
            else
            {
                using (IsolatedStorageFileStream isoStream1 = new IsolatedStorageFileStream(UIConstants.IsolatedStorage, FileMode.OpenOrCreate, isoStore))
                {
                    using (StreamReader reader = new StreamReader(isoStream1))
                    {
                        fromDataTime = reader.ReadLine();
                    }
                }
                if (!string.IsNullOrEmpty(fromDataTime)) //解密
                {
                    try
                    {
                        fromDataTime = EncodeHelper.DesDecrypt(fromDataTime, UIConstants.IsolatedStorageEncryptKey);
                    }
                    catch
                    {
                    }
                }
                return(fromDataTime);
            }
        }
        /// <summary>
        /// 加密并保存当前时间到"独立存贮空间" (以分号(;)追加保存)
        /// </summary>
        public static void SaveDataTime(DateTime fromDate)
        {
            string fromDataTime = fromDate.ToString("MM-dd-yyyy HH:mm:ss");
            string oldTime      = GetDataTime().Trim();

            if (!string.IsNullOrEmpty(oldTime))
            {
                fromDataTime = oldTime + ";" + fromDataTime;                                             //追加最后时间到左边
            }
            fromDataTime = EncodeHelper.DesEncrypt(fromDataTime, UIConstants.IsolatedStorageEncryptKey); //加密

            #region 将fromDataTime保存在"独立存贮空间"

            string username = fromDataTime;
            //按用户、域、程序集获取独立存储区
            IsolatedStorageFile isoStore =
                IsolatedStorageFile.GetStore(
                    IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, null, null);
            string[] myusername = isoStore.GetDirectoryNames(UIConstants.IsolatedStorageDirectoryName);
            IsolatedStorageFileStream isoStream1 = null;
            if (myusername.Length == 0) //没有目录
            {
                //创建目录
                isoStore.CreateDirectory(UIConstants.IsolatedStorageDirectoryName);
                //创建文件
                using (isoStream1 = new IsolatedStorageFileStream(UIConstants.IsolatedStorage, FileMode.Create, isoStore))
                {
                    //写入文件
                    using (StreamWriter writer = new StreamWriter(isoStream1))
                    {
                        writer.WriteLine(fromDataTime);
                    }
                }
            }
            else
            {
                myusername = isoStore.GetFileNames(UIConstants.IsolatedStorage);
                if (myusername.Length == 0) //没有文件
                {
                    //创建文件
                    using (isoStream1 = new IsolatedStorageFileStream(UIConstants.IsolatedStorage, FileMode.Create, isoStore))
                    {
                        //写入文件
                        using (StreamWriter writer = new StreamWriter(isoStream1))
                        {
                            writer.WriteLine(fromDataTime);
                        }
                    }
                }
                else
                {
                    using (isoStream1 = new IsolatedStorageFileStream(UIConstants.IsolatedStorage, FileMode.Open, isoStore))
                    {
                        //写入文件
                        using (StreamWriter writer = new StreamWriter(isoStream1))
                        {
                            writer.WriteLine(fromDataTime);
                        }
                    }
                }
            }

            #endregion
        }