devxlogo

Available Network APIs

Available Network APIs

Question:
I would like to know if I could obtain a listingof the functions in the netapi.dll file and howto declare them in VB. It would be mostappreciated.

Answer:
The API Text Viewer has the API calls available with their correct parameters for Visual Basic. As far as I know, all the network API calls begin with WNet, as in WNetAddConnection. Here is the text from the Win32API.TXT file available on your hard drive. I believe this is all of the applicable network functions, but they all appear to be in mpr.dll.

Declare Function WNetAddConnection Lib “mpr.dll” Alias “WNetAddConnectionA” (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As LongDeclare Function WNetAddConnection2 Lib “mpr.dll” Alias “WNetAddConnection2A” (lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Long) As LongDeclare Function WNetCancelConnection Lib “mpr.dll” Alias “WNetCancelConnectionA” (ByVal lpszName As String, ByVal bForce As Long) As LongDeclare Function WNetCancelConnection2 Lib “mpr.dll” Alias “WNetCancelConnection2A” (ByVal lpName As String, ByVal dwFlags As Long, ByVal fForce As Long) As LongDeclare Function WNetGetConnection Lib “mpr.dll” Alias “WNetGetConnectionA” (ByVal lpszLocalName As String, ByVal lpszRemoteName As String, cbRemoteName As Long) As LongDeclare Function WNetOpenEnum Lib “mpr.dll” Alias “WNetOpenEnumA” (ByVal dwScope As Long, ByVal dwType As Long, ByVal dwUsage As Long, lpNetResource As NETRESOURCE, lphEnum As Long) As LongDeclare Function WNetEnumResource Lib “mpr.dll” Alias “WNetEnumResourceA” (ByVal hEnum As Long, lpcCount As Long, lpBuffer As Any, lpBufferSize As Long) As LongDeclare Function WNetCloseEnum Lib “mpr.dll” Alias “WNetCloseEnum” (ByVal hEnum As Long) As LongDeclare Function WNetGetUser Lib “mpr.dll” Alias “WNetGetUserA” (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As LongDeclare Function WNetConnectionDialog Lib “mpr.dll” Alias “WNetConnectionDialog” (ByVal hwnd As Long, ByVal dwType As Long) As LongDeclare Function WNetDisconnectDialog Lib “mpr.dll” Alias “WNetDisconnectDialog” (ByVal hwnd As Long, ByVal dwType As Long) As LongDeclare Function WNetGetLastError Lib “mpr.dll” Alias “WNetGetLastErrorA” (lpError As Long, ByVal lpErrorBuf As String, ByVal nErrorBufSize As Long, ByVal lpNameBuf As String, ByVal nNameBufSize As Long) As Long

See also  5 Tips for Choosing the Right Medical Software for Your Practice
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist