How to create a hardlink in C#? Any code snippet, please?
The BCL doesn't provide this, so you'll have to resort to p/invoke
[DllImport("Kernel32.dll", CharSet = CharSet.Unicode )]
static extern bool CreateHardLink(
string lpFileName,
string lpExistingFileName,
IntPtr lpSecurityAttributes
);
And use it e.g. like
CreateHardLink(@"c:\temp\New Link", @"c:\temp\Original File",IntPtr.Zero);