Advertisement
MBrendecke

Untitled

Feb 29th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApplication1 {
  9.  
  10.   public sealed class Files {
  11.     private readonly string _filename;
  12.  
  13.     private Files(string filename) {
  14.       _filename = filename;
  15.     }
  16.  
  17.     public static implicit operator string(Files file) {
  18.       return file._filename;
  19.     }
  20.  
  21.     public static Files RegDat = new Files(@"C:\Users\Public\RegDatC.txt");
  22.     public static Files S_RegDat = new Files(@"C:\Users\Public\Sicherung_RegDatC.txt");
  23.   }
  24.  
  25.   public static class Global {
  26.     public static FileStream RegDatei { get; set; }
  27.     public static StreamReader Lesen { get; set; }
  28.     public static StreamWriter Schreiben { get; set; }
  29.  
  30.     public static FileInfo Datei(Files file) {
  31.       try {
  32.         return new FileInfo(file);
  33.       } catch (Exception) { throw; }
  34.     }
  35.   }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement