Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "NetResource" in [All]

mpr

.

        NetResource lpNetResource,

.

    private class NETRESOURCE

.

private static extern int WNetAddConnection2( NETRESOURCE lpNetResource,

.

NETRESOURCE nr = new NETRESOURCE();

.

/* Uses Struct rather than class version of NETRESOURCE */

.

    ref NETRESOURCE lpNetResource, string lpPassword,

.

    ''' <param name="lpNetResource"></param>

.

                           ByVal lpNetResource As NETRESOURCE, _

.

NETRESOURCE

.

NETRESOURCE ConnInf = new NETRESOURCE();

.

// This must be used if NETRESOURCE is defined as a struct

.

public static extern int WNetAddConnection2(ref NETRESOURCE netResource,

.

// This must be used if NETRESOURCE is defined as a class

.

public static extern int WNetAddConnection2(NETRESOURCE netResource,

.

// my NETRESOURCE is defined as:

.

//    class NETRESOURCE

.

  //      private class NETRESOURCE

.

  //      private static extern ErrorCodes WNetAddConnection2(NETRESOURCE lpNetResource,ref string lpPassword,ref

.

public static extern int WNetAddConnection2( [In] NETRESOURCE netResource,

.

' This must be used if NETRESOURCE is defined as a struct

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (ByRef netResource As _

.

   NETRESOURCE, password As String, Username As String, Flag As Integer) As Integer

.

' This must be used if NETRESOURCE is defined as a class

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (netResource As _

.

   NETRESOURCE, password As String, Username As String, Flag As Integer) As Integer

.

NETRESOURCE

.

NETRESOURCE myNetResource = new NETRESOURCE();        

.

myNetResource.dwScope = 2;                    

.

myNetResource.dwType = 1 ;                    

.

myNetResource.dwDisplayType = 3;            

.

myNetResource.dwUsage = 1;            

.

myNetResource.LocalName = "z:";        

.

myNetResource.RemoteName = @"\servername\sharename";        

.

myNetResource.Provider = null;        

.

// int ret = WNetAddConnection2( myNetResource, "username", "password", 0);

.

int ret = WNetAddConnection2( myNetResource, "password", "username", 0); //by honglinlee

.

    var netResource = new NetResource()

.

        netResource,

.

    private static extern int WNetAddConnection2(NetResource netResource,

.

public class NetResource

.

    private class NETRESOURCE

.

    private static extern int WNetAddConnection2(NETRESOURCE lpNetResource, string lpPassword, string lpUsername, int dwFlags);

.

        NETRESOURCE myNetResource = new NETRESOURCE();

.

        myNetResource.lpLocalName = drive;

.

        myNetResource.lpRemoteName = unc;

.

        myNetResource.lpProvider = null;

.

        int result = WNetAddConnection2(myNetResource, password, user, 0);

.

    Dim myResource As NETRESOURCE

.

/* Uses Struct rather than class version of NETRESOURCE */

.

    ref NETRESOURCE lpNetResource, string lpPassword,

.

    ''' <param name="lpNetResource"></param>

.

                           ByRef lpNetResource As NETRESOURCE, _

.

NETRESOURCE

.

NETRESOURCE ConnInf = new NETRESOURCE();

.

    [MarshalAs(UnmanagedType.AsAny)][In] Object lpNetResource,

.

public struct NETRESOURCE

.

       NETRESOURCE nr;

.

        nr = (NETRESOURCE)Marshal.PtrToStructure( ptr, typeof(NETRESOURCE) );

.

    Public Structure NETRESOURCE

.

    Public Function WNetOpenEnum(ByVal dwScope As RESOURCE_SCOPE, ByVal dwType As RESOURCE_TYPE, ByVal dwUsage As RESOURCE_USAGE, ByRef lpNetResource As NETRESOURCE, ByRef lphEnum As IntPtr) As Integer

.

    Public Function GetNetworkDrives(ByRef o As NETRESOURCE, ByRef networkDriveCollection As List(Of String)) As Boolean

.

        Dim nr As NETRESOURCE

.

            nr = CType(Marshal.PtrToStructure(ptr, GetType(NETRESOURCE)), NETRESOURCE)

.

    Public Function GetNetworkComputers(ByRef o As NETRESOURCE, ByRef networkComputersCollection As List(Of String)) As Boolean

.

        Dim nr As NETRESOURCE

.

            nr = CType(Marshal.PtrToStructure(New IntPtr(ptr), GetType(NETRESOURCE)), NETRESOURCE)

.

    Public Function WNETOE(ByRef o As NETRESOURCE, ByRef resourceCollection As List(Of String)) As Boolean

.

        Dim nr As NETRESOURCE

.

            nr = CType(Marshal.PtrToStructure(New IntPtr(ptr), GetType(NETRESOURCE)), NETRESOURCE)

.

public static extern UInt32 WNetOpenEnum(ResourceScope dwScope, ResourceType dwType, ResourceUsage dwUsage, NetResource lpNetResource, ref IntPtr lphEnum);

.

Public Shared Function WNetOpenEnum(dwScope As ResourceScope, dwType As ResourceType, dwUsage As ResourceUsage, lpNetResource As NetResource, ByRef lphEnum As IntPtr) As UInteger

.

ResourceScope, ResourceType, ResourceUsage, NetResource

.

    NETRESOURCE lpNetResource,

.

private class NETRESOURCE

.

    NETRESOURCE nr = new NETRESOURCE()

.

    NETRESOURCE nr = new NETRESOURCE()

Structures

.

class NETRESOURCE

.
Documentation
[NETRESOURCE] on MSDN

 
Access PInvoke.net directly from VS: