/// <summary>Get temp folder on the system</summary> /// <returns></returns> private static String GetEnvTempFolder() { String tempFolder; #if !PocketPC tempFolder = OSEnvironment.get("TEMP"); #else tempFolder = OSEnvironment.getTempFolder(); #endif return(tempFolder); }
/// <summary> /// CTOR /// </summary> private EnvControlsPersistencyPath() { #if PocketPC _defaultPath = OSEnvironment.getAssemblyFolder(); #else //1. If the path is not defined (default) then the files will be created in the (same folder as the form state persistency file.) //• In xp: C:\Documents and Settings\<user>\Application Data\MSE\<APP GUI ID>\ //• In Win 7 and Win 8: C:\Users\<user>\AppData\Roaming\MSE\<APP GUI ID> _defaultPath = OSEnvironment.get("APPDATA") + Path.DirectorySeparatorChar + (UtilStrByteMode.isLocaleDefLangJPN() ? "MSJ" : "MSE") + Path.DirectorySeparatorChar; #endif }
/// <summary> /// CTOR /// </summary> private FormUserState() { IsDisabled = false; #if PocketPC _dirPath = OSEnvironment.getAssemblyFolder(); #else _dirPath = OSEnvironment.get("APPDATA") + Path.DirectorySeparatorChar + (UtilStrByteMode.isLocaleDefLangJPN() ? "MSJ" : "MSE") + Path.DirectorySeparatorChar + Manager.Environment.GetGUID() + Path.DirectorySeparatorChar; #endif }
/// <summary>Initialize StudioLauncher error log --> %TEMP%\RCLauncherError.log</summary> private void InitLogWriter() { String logTarget = OSEnvironment.get("TEMP") + @"\RCLauncherError.log"; try { _logWriter = new StreamWriter(new FileStream(logTarget, FileMode.Append, FileAccess.Write, FileShare.Read)); } catch (IOException) { // if the log file is in use, insert the current process ID into the name: *.pid.suffix logTarget = logTarget.Insert(logTarget.LastIndexOf('.'), "." + System.Diagnostics.Process.GetCurrentProcess().Id.ToString()); try { _logWriter = new StreamWriter(new FileStream(logTarget, FileMode.Append, FileAccess.Write, FileShare.Read)); } catch { } } catch { } if (_logWriter != null) { _logWriter.AutoFlush = true; } }