开发者

C# -Connect unc path with credentials

开发者 https://www.devze.com 2022-12-14 03:01 出处:网络
I have a UNC folder added in my machine开发者_Go百科 using \"Add Network Places\" option in \"My Network Places\" (XP).

I have a UNC folder added in my machine开发者_Go百科 using "Add Network Places" option in "My Network Places" (XP). I need to select the specific unc folder through my C# "folderBrowser Dialogue." However,as unc path is password protected. While selecting the same,how can I prompt for userCredentials. can anyone have thoughts on this...


PInvoke to WNetAddConnection2 and pass the CONNECT_INTERACTIVE flag to allow the OS to pop a username/password prompt if necessary. You can get the PInvoke definition here.

0

精彩评论

暂无评论...
验证码 换一张
取 消