Horje
c# if file doesn't exist create it Code Example
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
c# modify dictionary in loop Code Example c# modify dictionary in loop Code Example
c# sum object values Code Example c# sum object values Code Example
convert text to number C# Code Example convert text to number C# Code Example
asp net c# browser cursor wait Code Example asp net c# browser cursor wait Code Example
c# convert double to string Code Example c# convert double to string Code Example

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