Пример #1
0
        /// <summary>Returns the path of the current system's temporary folder.</summary>
        /// <returns>A <see cref="T:System.String" /> containing the path information of a temporary directory.</returns>
        /// <exception cref="T:System.Security.SecurityException">The caller does not have the required permissions. </exception>
        /// <filterpriority>1</filterpriority>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        /// </PermissionSet>
        public static string GetTempPath()
        {
            string temp_path = Path.get_temp_path();

            if (temp_path.Length > 0 && temp_path[temp_path.Length - 1] != Path.DirectorySeparatorChar)
            {
                return(temp_path + Path.DirectorySeparatorChar);
            }
            return(temp_path);
        }