コード例 #1
0
        public void CreateNewFile(bool left)
        {
            string currentPath;

            if (left)
            {
                currentPath = CurrentPath1;
            }
            else
            {
                currentPath = CurrentPath2;
            }

            CreateFolder Cr_fold = new CreateFolder(true);

            Cr_fold.ShowDialog();
            if (Cr_fold.create)
            {
                if (!File.Exists(currentPath + "\\" + Cr_fold.path))
                {
                    File.Create(currentPath + "\\" + Cr_fold.path);
                }
                else
                {
                    MessageBox.Show("Файл з таким іменем вже існує");
                }
            }
            Cr_fold.Dispose();
        }
コード例 #2
0
        public void CreateNewFolder(bool left)
        {
            string currentPath;

            if (left)
            {
                currentPath = CurrentPath1;
            }
            else
            {
                currentPath = CurrentPath2;
            }

            CreateFolder Cr_fold = new CreateFolder();

            Cr_fold.ShowDialog();
            if (Cr_fold.create)
            {
                if (!Directory.Exists(currentPath + "\\" + Cr_fold.path))
                {
                    Directory.CreateDirectory(currentPath + "\\" + Cr_fold.path);
                }
                else
                {
                    MessageBox.Show("Папка з таким іменем вже існує");
                }
            }
            Cr_fold.Dispose();
        }