Horje
c# create file if not exists Code Example
c# create file if not exists
string rootPath = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System));
        rootPath += "MTN";
        if (!(File.Exists(rootPath)))
        {
            File.CreateText(rootPath);
        }
c# if file doesn't exist create it
string temp = AppDomain.CurrentDomain.BaseDirectory;
string sPath = Path.Combine(temp, "file.txt");

bool fileExist = File.Exists(sPath);
        if (fileExist) {
            Console.WriteLine("File exists.");
        }
        else {
          using (File.Create(sPath)) ;
            Console.WriteLine("File does not exist.");
        }




Csharp

Related
remove adding framework target bin folder Code Example remove adding framework target bin folder Code Example
unity cannot click button Code Example unity cannot click button Code Example
entity framework delete record with foreign key constraint Code Example entity framework delete record with foreign key constraint Code Example
c# combobox selected item Code Example c# combobox selected item Code Example
ffmpeg add audio to video at specific time Code Example ffmpeg add audio to video at specific time Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10