GetTempPath() now supports: return a full path with filename combined which pointed to the temporary directory

This commit is contained in:
kimw
2016-01-04 23:56:43 +08:00
parent 2cce646700
commit 64390d45ac
12 changed files with 138 additions and 123 deletions
+14 -10
View File
@@ -1,13 +1,13 @@
using Shadowsocks.Controller;
using Shadowsocks.Properties;
using Shadowsocks.View;
using System;
using System.Collections.Generic;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using Shadowsocks.Controller;
using Shadowsocks.Util;
using Shadowsocks.View;
namespace Shadowsocks
{
static class Program
@@ -18,7 +18,7 @@ namespace Shadowsocks
[STAThread]
static void Main()
{
Util.Utils.ReleaseMemory(true);
Utils.ReleaseMemory(true);
using (Mutex mutex = new Mutex(false, "Global\\Shadowsocks_" + Application.StartupPath.GetHashCode()))
{
Application.EnableVisualStyles();
@@ -37,15 +37,19 @@ namespace Shadowsocks
return;
}
Directory.SetCurrentDirectory(Application.StartupPath);
#if DEBUG
Logging.OpenLogFile();
// truncate privoxy log file while debugging
string privoxyLogFilename = Utils.GetTempPath("privoxy.log");
if (File.Exists(privoxyLogFilename))
using (new FileStream(privoxyLogFilename, FileMode.Truncate)) { }
#else
Logging.OpenLogFile();
#endif
ShadowsocksController controller = new ShadowsocksController();
MenuViewController viewController = new MenuViewController(controller);
controller.Start();
Application.Run();
}
}