How to provide user name and password when connecting to a network share

后端 未结 11 1845
不知归路
不知归路 2020-11-22 00:34

When connecting to a network share for which the current user (in my case, a network enabled service user) has no rights, name and password have to be provided.

I kn

11条回答
  •  孤城傲影
    2020-11-22 01:28

    If you can't create an locally valid security token, it seems like you've ruled all out every option bar Win32 API and WNetAddConnection*.

    Tons of information on MSDN about WNet - PInvoke information and sample code that connects to a UNC path here:

    http://www.pinvoke.net/default.aspx/mpr/WNetAddConnection2.html#

    MSDN Reference here:

    http://msdn.microsoft.com/en-us/library/aa385391(VS.85).aspx

提交回复
热议问题