Exemplo n.º 1
0
        /// <summary>
        /// Creates a symbolic link. This requires administration privileges and is only supported on Windows Vista and above.
        /// </summary>
        /// <param name="symLinkPath">The path for the symbolic link. Can be relative or absolute.</param>
        /// <param name="targetPath">The path for the target of the symbolic link. Can be relative or absolute.</param>
        /// <param name="flags">The flags to use</param>
        /// <exception cref="IOException">An error occurred during the operation</exception>
        public static void CreateSymbolicLink(string symLinkPath, string targetPath, SymbolicLinkFlags flags)
        {
            if (_CreateSymbolicLink(symLinkPath, targetPath, flags))
            {
                return;
            }

            // Get reason for failure if it failed
            var ex = new Win32Exception();

            throw new IOException(ex.Message, ex);
        }
Exemplo n.º 2
0
 public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, SymbolicLinkFlags dwFlags);
Exemplo n.º 3
0
 public static extern bool CreateSymbolicLink(string sourceFileName, string targetFileName, SymbolicLinkFlags flags);
Exemplo n.º 4
0
 internal static extern bool CreateSymbolicLink(string target, string source, SymbolicLinkFlags flags);
Exemplo n.º 5
0
 public static extern bool CreateSymbolicLink(string linkFile, string targetFile, SymbolicLinkFlags flags);
Exemplo n.º 6
0
 public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, SymbolicLinkFlags dwFlags);