Using UNC path with credentials

29,161

Solution 1

It might be useful for you to use the NetUseAdd function from the windows api http://msdn.microsoft.com/en-us/library/windows/desktop/aa370645(v=vs.85).aspx. It allows you to access a directory through its UNC path.

Solution 2

Looks like Win32 APIs are the most common way to handle this. Check out this SO post Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials

Share:
29,161
avmauricio
Author by

avmauricio

A programmer guy from Costa Rica!

Updated on August 07, 2020

Comments

  • avmauricio
    avmauricio almost 4 years

    I'm working on an app that uses an UNC path to access remote files in the same LAN. The problem is that when access is attempted it throws an exception related to Windows credentials.

    Is there a way to add credentials to my UNC path?

    Thank you