Ignore:
Timestamp:
May 21, 2010, 4:00:55 PM (12 years ago)
Author:
Paul Lelgemann
Message:
  • Removed unused references and using statement in CrypP2P, PeerToPeer, PeerToPeerBaseProxy

+ Skeleton for P2PEditor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/PeerToPeer/DebugToFile.cs

    r1433 r1458  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
     2using System.IO;
    43using System.Text;
    5 using System.IO;
    64
    75namespace Cryptool.Plugins.PeerToPeer.Internal
     
    1210        private static string sPath = @"c:\p2p_debug";
    1311        private static string sFileName = "p2p_debug";
    14         private static string sDateTime = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString()
    15             + DateTime.Now.Day.ToString() + "_" + DateTime.Now.Hour.ToString()
    16             + DateTime.Now.Minute.ToString();
    1712
    18         public static string Path
     13        private static readonly string sDateTime = DateTime.Now.Year + DateTime.Now.Month.ToString()
     14                                                   + DateTime.Now.Day + "_" + DateTime.Now.Hour
     15                                                   + DateTime.Now.Minute;
     16
     17        public static string Path
    1918        {
    2019            get { return sPath; }
    21             private set 
    22             { 
     20            private set
     21            {
    2322                // last character must not be a Backslash!
    2423                if (value.Substring(value.Length - 1, 1) == @"\")
     
    3231        {
    3332            get { return sFileName; }
    34             private set 
     33            private set
    3534            {
    3635                if (value.Substring(value.Length - 3, 1) == ".")
     
    6261                i++;
    6362            }
    64             FileInfo fileInfo = new FileInfo(Path + @"\" + FileName + "_" + sDateTime + ".txt");
     63            var fileInfo = new FileInfo(Path + @"\" + FileName + "_" + sDateTime + ".txt");
    6564            sw = fileInfo.CreateText();
    6665            return sw;
     
    7675                }
    7776                catch (Exception ex)
    78                 { }
     77                {
     78                }
    7979                sw.Close();
    8080                sw.Dispose();
     
    8787        {
    8888            DateTime now = DateTime.Now;
    89             StringBuilder sbTimeStamp = new StringBuilder();
     89            var sbTimeStamp = new StringBuilder();
    9090
    9191            if (now.Hour <= 9)
    9292                sbTimeStamp.Append("0");
    93             sbTimeStamp.Append(now.Hour.ToString() + ".");
     93            sbTimeStamp.Append(now.Hour + ".");
    9494            if (now.Minute <= 9)
    9595                sbTimeStamp.Append("0");
    96             sbTimeStamp.Append(now.Minute.ToString() + ".");
     96            sbTimeStamp.Append(now.Minute + ".");
    9797            if (now.Second <= 9)
    9898                sbTimeStamp.Append("0");
    99             sbTimeStamp.Append(now.Second.ToString() + ":");
     99            sbTimeStamp.Append(now.Second + ":");
    100100            if (now.Millisecond <= 9)
    101101                sbTimeStamp.Append("00");
Note: See TracChangeset for help on using the changeset viewer.