How can I obtain the username of the current connected network neighbor? How to completely disconnect all network neighbors? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061111102009253.html
This is the case. I opened a share on the server (Windows2003) and needed an account and a password client (WindowsXP) to access it, because every time I connect to a network neighbor, windows will automatically record the session. You do not need to enter the account and password the next time you open the sharing, and you cannot log on again with another user name. The key is here, I need to know the current user name to determine whether to log on again...
I cannot log on again with different user names, so I need to disconnect all network neighbors to log on again. I use wnetaddconnection2 to connect, and wnetcancelconnection2 to disconnect, however, wnetcancelconnection2 cannot be disconnected at times, and sometimes it takes a while to be disconnected. So I want to ask if there is any better solution? Wnetdisconnectdialog can't be disconnected either, because they can only be disconnected from the previously connected location with wnetaddconnection2, And the rest won't be disconnected ....
Please help me ~~~
Why haven't anyone helped me over the past few days?