Пример #1
0
        public static bool Initialize()
        {
            random = new Random(int.Parse(DateTime.Now.Ticks.ToString().Substring(12)));

            bool bSuccess = true;

            // Initialize WebClient for ApiClient Class
            FluxApiClient.Initialize();

            // Initialize Variables From Data Source (ex: Registry Parent Keys) ***************************************************************** remove 1 == 1 ********************************************
            if (System.IO.File.Exists(System.Windows.Forms.Application.ExecutablePath + "\\installed.txt") == false || 1 == 1)
            {
                var chars       = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                var stringChars = new char[8];
                var random      = new Random();

                for (int i = 0; i < stringChars.Length; i++)
                {
                    stringChars[i] = chars[random.Next(chars.Length)];
                }

                var finalString = new String(stringChars);

                sInstallDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + finalString;

                if (System.IO.Directory.Exists(sInstallDirectory) == false)
                {
                    System.IO.Directory.CreateDirectory(sInstallDirectory);
                }
            }
            else
            {
                sInstallDirectory = System.Windows.Forms.Application.ExecutablePath;
            }

            if (FluxInstaller.checkMethInstalled() == false)
            {
                FluxInstaller fluxInstaller = new FluxInstaller();
                fluxInstaller.installMeth();
            }

            return(bSuccess);
        }
Пример #2
0
        public static bool Initialize()
        {
            random = new Random(int.Parse(DateTime.Now.Ticks.ToString().Substring(12)));

            bool bSuccess = true;

            // Initialize WebClient for ApiClient Class
            FluxApiClient.Initialize();

            // Initialize Variables From Data Source (ex: Registry Parent Keys) ***************************************************************** remove 1 == 1 ********************************************
            if (System.IO.File.Exists(System.Windows.Forms.Application.ExecutablePath + "\\installed.txt") == false || 1 == 1)
            {
                var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                var stringChars = new char[8];
                var random = new Random();

                for (int i = 0; i < stringChars.Length; i++)
                {
                    stringChars[i] = chars[random.Next(chars.Length)];
                }

                var finalString = new String(stringChars);

                sInstallDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + finalString;

                if (System.IO.Directory.Exists(sInstallDirectory) == false)
                {
                    System.IO.Directory.CreateDirectory(sInstallDirectory);
                }
            }
            else
            {
                sInstallDirectory = System.Windows.Forms.Application.ExecutablePath;
            }

            if (FluxInstaller.checkMethInstalled() == false)
            {
                FluxInstaller fluxInstaller = new FluxInstaller();
                fluxInstaller.installMeth();
            }

            return bSuccess;
        }