Using UNC path with credentials

心不动则不痛 提交于 2019-12-05 23:40:50

问题


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


回答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.




回答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



来源:https://stackoverflow.com/questions/10214596/using-unc-path-with-credentials

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!