Online/disconnected Network Disk Drive dialog box

Source: Internet
Author: User

This example is to use the API to open the online/interrupted Network Disk Drive dialog box. We must use the flat. the wnetconnectiondialog and wnetdisconnectdialog types of the DLL api library are completed. The following tapimpr categories are the operation records. dll library category.

 

 
1:''' <Summary>
 
2:''' Network neighbor-related correspondence Library (FLPs. dll ).
 
3:''' </Summary>
 
4:Public Notinheritable ClassTapimpr
 
5: 
6:Public EnumEresourcetypeAs Integer
 
7:''' <Summary>
 
8:''' Any resource.
 
9:''' </Summary>
 
10:Resourcetype_any = & H0
 
11:''' <Summary>
 
12:''' Network Disk Drive.
13:''' </Summary>
 
14:Resourcetype_disk = & H1
 
15:''' <Summary>
 
16:''' Network printer.
 
17:''' </Summary>
 
18:Resourcetype_print = & H2
 
19:''' <Summary>
 
20:''' Unknown.
21:''' </Summary>
 
22:Resourcetype_unknown = & hffffffff
 
23:End Enum
 
24: 
 
25:''' <Summary>
 
26:''' Online Network Disk Drive dialog box.
 
27:''' </Summary>
 
28:<Dllimport ("MIP. dll", Charset: = charset.Auto)> _
29:Public Shared FunctionWnetconnectiondialog (ByvalHwndAsIntptr,ByvalTypeAsEresourcetype)As Integer
 
30:End Function
 
31: 
 
32:''' <Summary>
 
33:'''Disconnect a Network Disk Drive dialog box.
 
34:''' </Summary>
35:<Dllimport ("MIP. dll", Charset: = charset.Auto)> _
 
36:Public Shared FunctionWnetdisconnectdialog (ByvalHwndAsIntptr,ByvalTypeAsEresourcetype)As Integer
 
37:End Function
 
38: 
 
39:EndClass

 

The following figure shows how to call the wnetconnectiondialog API and wnetdisconnectdialog function.

 
1:''' <Summary>
 
2:''' Online Network Disk Drive dialog box.
 
3:''' </Summary>
 
4:''' <Param name = "handle"> window handle. </Param>
 
5:''' <Returns> returns true after going online, and false if not. </Returns>
6:Public Overloads Shared FunctionNetconnectiondialog (ByvalHandleAsIntptr)As Boolean
 
7:DimIresultAs Integer
 
8: 
 
9:Iresult = tapimpr. wnetconnectiondialog (handle, tapimpr. eresourcetype. resourcetype_disk)
 
10:ReturnIresult = 0
11:End Function
 
12: 
 
13:''' <Summary>
 
14:'''Disconnect a Network Disk Drive dialog box.
 
15:''' </Summary>
 
16:''' <Param name = "handle"> window handle. </Param>
 
17:''' <Returns> returns true successfully. Otherwise, returns false. </Returns>
18:Public Overloads Shared FunctionNetdisconnectdialog (ByvalHandleAsIntptr)As Boolean
 
19:DimIresultAs Integer
 
20: 
 
21:Iresult = tapimpr. wnetdisconnectdialog (handle, tapimpr. eresourcetype. resourcetype_disk)
 
22:ReturnIresult = 0
23:End Function

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.