示例#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);
        }
示例#2
0
 public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, SymbolicLinkFlags dwFlags);
示例#3
0
 public static extern bool CreateSymbolicLink(string sourceFileName, string targetFileName, SymbolicLinkFlags flags);
示例#4
0
 internal static extern bool CreateSymbolicLink(string target, string source, SymbolicLinkFlags flags);
示例#5
0
 public static extern bool CreateSymbolicLink(string linkFile, string targetFile, SymbolicLinkFlags flags);
示例#6
0
 public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, SymbolicLinkFlags dwFlags);