How can I obtain the username of the current connected network neighbor? How to completely disconnect all network neighbors?

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.