MBrendecke icon

Untitled

MBrendecke | PRO | 02/29/16 03:21:00 PM UTC | 0 ⭐ | 386 👁️ | Never ⏰ | []
C# |

920 B

|

None

|

0 👍

/

0 👎

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApplication1 {
 
  public sealed class Files {
    private readonly string _filename;
 
    private Files(string filename) {
      _filename = filename;
    }
 
    public static implicit operator string(Files file) {
      return file._filename;
    }
 
    public static Files RegDat = new Files(@"C:\Users\Public\RegDatC.txt");
    public static Files S_RegDat = new Files(@"C:\Users\Public\Sicherung_RegDatC.txt");
  }
 
  public static class Global {
    public static FileStream RegDatei { get; set; }
    public static StreamReader Lesen { get; set; }
    public static StreamWriter Schreiben { get; set; }
 
    public static FileInfo Datei(Files file) {
      try {
        return new FileInfo(file);
      } catch (Exception) { throw; }
    }
  }
}

Comments