create needed folders if they not exist

This commit is contained in:
Alexander Eckart committed 2012-02-24 07:53:51 +01:00
1 parent 0e73a77c0b
commit bc0e42af45
5 files changed
+22 -6

No files matched your search

+21
View File
@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Text; using System.Text;
namespace Vocaluxe.Base namespace Vocaluxe.Base
@@ -140,5 +141,25 @@ namespace Vocaluxe.Base
{ {
MouseMoveDiffMin = 3; MouseMoveDiffMin = 3;
} }
public static void CreateFolders()
{
List<string> Folders = new List<string>();
Folders.Add(sFolderCover);
Folders.Add(sFolderFonts);
Folders.Add(sFolderProfiles);
Folders.Add(sFolderSongs);
Folders.Add(sFolderScreenshots);
Folders.Add(sFolderBackgroundMusic);
Folders.Add(sFolderSounds);
foreach (string folder in Folders)
{
string path = Path.Combine(Environment.CurrentDirectory, folder);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
}
}
} }
} }
-2
View File
@@ -461,8 +461,6 @@ namespace Vocaluxe.Lib.Draw
{ {
string file = "Screenshot_"; string file = "Screenshot_";
string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots); string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
int i = 0; int i = 0;
while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".bmp"))) while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".bmp")))
-2
View File
@@ -300,8 +300,6 @@ namespace Vocaluxe.Lib.Draw
{ {
string file = "Screenshot_"; string file = "Screenshot_";
string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots); string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
int i = 0; int i = 0;
while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".png"))) while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".png")))
-2
View File
@@ -556,8 +556,6 @@ namespace Vocaluxe.Lib.Draw
{ {
string file = "Screenshot_"; string file = "Screenshot_";
string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots); string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
int i = 0; int i = 0;
while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".bmp"))) while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".bmp")))
+1
View File
@@ -33,6 +33,7 @@ namespace Vocaluxe
// Init Log // Init Log
CLog.Init(); CLog.Init();
CSettings.CreateFolders();
Application.DoEvents(); Application.DoEvents();
// Init Language // Init Language