示例#1
0
文件: Program.cs 项目: Oxigen2/Oxigen
        private static void FileAccessRights()
        {
            if (!FileDirectoryRightsChecker.AreFilesReadableWritable(_appDataPath))
            {
                _displayMessage  = Resources.NoLogFileRights;
                _appToRun        = "";
                _bErrorOnStartup = true;
            }

            _logger.WriteTimestampedMessage("file access rights tested successfully.");
        }
示例#2
0
        private bool FileAccessRights()
        {
            // check permissions on all applicable directories for write access
            // if no write access return
            bool bReadableWritableAppDataPath = FileDirectoryRightsChecker.AreFilesReadableWritable(_appDataPath);
            bool bCanCreateDirectoriesPath    = FileDirectoryRightsChecker.CanCreateDeleteDirectories(_appDataPath);

            if (!bReadableWritableAppDataPath || !bCanCreateDirectoriesPath)
            {
                return(false);
            }

            return(true);
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.ShowDialog();

            if (folderBrowserDialog1.SelectedPath == "")
            {
                return;
            }

            bool b = false;

            try
            {
                b = FileDirectoryRightsChecker.AreFilesReadableWritable(folderBrowserDialog1.SelectedPath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            label1.Text = b.ToString();
        }