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
Download Visual Studio Add-In

Search Results for "connect" in [All]

netapi32

.

    if (MessageBox.Show(this, "Are you sure you want to close this connection?" == DialogResult.Yes))

.

    If MsgBox("Are you sure you want to disconnect this resource?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then

.

lpAccount - (in) Pointer to a constant string that specifies an account name to use when connecting to the domain controller. If this parameter is NULL, the caller's context is used.

.

lpPassword - (in) If the lpAccount parameter specifies an account name, this parameter must point to the password to use when connecting to the domain controller. Otherwise, this parameter must be NULL.

.

    public int AutoDisconnectMinutes;

.
Summary
Deletes a network session. A better explanation would be that this api disconnects another computer which is connected to your computer. If the user is copying files then he/she will receive an error. This however does not stop the user from reconnecting.
.

    ''' <param name="UncClientName">[in] Pointer to a string that specifies the computer name of the client to disconnect. If UncClientName is NULL, then all the sessions of the user identified by the username parameter will be deleted on the server specified by servername.</param>

.

        /// Unable to contact resource. Connection timed out.

.

        /// No available network connection to make call.

.

lpAccount - (in) Pointer to a constant string that specifies the account name to use when connecting to the domain controller. The string must specify either a domain NetBIOS name and user account (for example, "REDMOND\user") or the user principal name (UPN) of the user in the form of an Internet-style login name (for example, "someone@example.com"). If this parameter is NULL, the caller's context is used.

.

lpPassword - (in) If the lpAccount parameter specifies an account name, this parameter must point to the password to use when connecting to the domain controller. Otherwise, this parameter must be NULL.

.
Summary
The NetUseAdd function establishes a connection between the local computer and a remote server. You can specify a local drive letter or a printer device to connect. If you do not specify a local drive letter or printer device, the function authenticates the client with the server for future connections.
.

You can also use the WNetAddConnection2 and WNetAddConnection3 functions to redirect a local device to a network resource. Connections added by NetUseAdd are not shown in the Explorer. You should use one of the WNetAddConnection methods to make the networkdrive visible in the explorer.

.
Summary
The NetUseDel function ends a connection to a shared resource.
.

You can also use the WNetCancelConnection2 function to terminate a network connection.

.
Summary
NetUseEnum - The NetUseEnum function lists all current connections between the local computer and resources on remote servers.
.

            // now step through all network shares and check if we have already a connection to the server

.

        //  Connection/Session counts

.

        public int Reconnects;

.

        public int CoreConnects;

.

        public int Lanman20Connects;

.

        public int Lanman21Connects;

.

        public int LanmanNtConnects;

.

        public int ServerDisconnects;

Interfaces

.

    ,BINDSTATUS_CONNECTING

.

        // IConnectionPoint errors

.

        CONNECT_E_FIRST = 0x80040200,

.

        CONNECT_E_NOCONNECTION,  // there is no connection for this connection id

.

        CONNECT_E_ADVISELIMIT,   // this implementation's limit for advisory connections has been reached

.

        CONNECT_E_CANNOTCONNECT, // connection attempt failed

.

        CONNECT_E_OVERRIDDEN,    // must use a derived interface to connect

.

        INET_E_CANNOT_CONNECT = 0x800C0004,

.

        INET_E_CONNECTION_TIMEOUT = 0x800C000B,

.

                case HRESULTS.INET_E_CANNOT_CONNECT:

.

                    Description = "Cannot Connect";break;

.

                case HRESULTS.INET_E_CONNECTION_TIMEOUT:

.

                    Description = "Connection Timeout.";break;

.

    public interface IConnector

.

    int GetType(out ConnectorType pType);

.

    int ConnectTo([In] IConnector connector);

.

    int Disconnect();

.

    int IsConnected(out bool pbConnected);

.

    int GetConnectedTo([Out, MarshalAs(UnmanagedType.LPArray)] out IConnector ppConTo);

.

    int GetConnectorIdConnectedTo(out string ppwstrConnectorId);

.

    int GetDeviceIdConnectedTo(out string ppwstrDeviceId);

.

Interface IConnector

.
Documentation
[IConnector] on MSDN
.

    int DAdvise([In] ref FORMATETC pFormatetc, ADVF advf, IAdviseSink adviseSink, out int connection);

.

    void DUnadvise(int connection);

.

    int GetConnectorCount([Out] out int pConnectorCount);

.

    int GetConnector(int nIndex, out IConnector ppConnector);

.

Starting point only - I only got as far as making getconnectorcount and getconnector return valid information on my machine. The other functions may or may not work!

.

     void Advise(object pAdvSink, uint pdwConnection);

.

     void Unadvise(uint dwConnection);

.

    TASK_FLAG_RUN_IF_CONNECTED_TO_INTERNET = 0x400,

.

// Connection Sink for listening to collection changes

.

     // Connects the framework and the application

gdiplus

.

   bool connect);

user32

.
Summary
.

static extern IntPtr DdeConnect(uint idInst, IntPtr hszService,

.

IntPtr handle = DdeConnect(instanceId, serviceHandle, topicHandle, IntPtr.Zero);

.
Documentation
[DdeConnect] on MSDN
.
Summary
.

static extern IntPtr DdeReconnect(IntPtr hConv);

.
Documentation
[DdeReconnect] on MSDN

Structures

.

  MIXERLINE_LINEF_DISCONNECTED = &H8000

.

        public bool fConnected;

.

        internal bool fReturnConnected;

.
Summary
The MIB_TCP6ROW_OWNER_PID structure contains information that describes an IPv6 TCP connection associated with a specific process ID (PID).
.
Summary
The MIB_TCPROW_OWNER_PID structure contains information that describes an IPv4 TCP connection with IPv4 addresses, ports used by the TCP connection, and the specific process ID (PID) associated with connection.
.

     DISCONNECTED    = 0x00008000u,

.

Without the Structlayout the WNetAddConnection2 does not work !!!

.
Summary
.
Summary
stores the statistics for a single-link RAS connection, or for one of the links in a multilink RAS connection.
.

     public int dwConnectionDuration;

.

     Public dwConnectionDuration As Integer

.

See docs for RasGetConnectionStatistics

.

        //  Connection/Session counts

.

        public int Reconnects;

.

        public int CoreConnects;

.

        public int Lanman20Connects;

.

        public int Lanman21Connects;

.

        public int LanmanNtConnects;

.

        public int ServerDisconnects;

.

    public bool AoAcConnectivitySupported;  // Ignore if earlier than Windows 10 (10.0.10240.0)

.

    TCP_TABLE_BASIC_CONNECTIONS,

.

    TCP_TABLE_OWNER_PID_CONNECTIONS,

.

    TCP_TABLE_OWNER_MODULE_CONNECTIONS,

.

    TCP_TABLE_BASIC_CONNECTIONS

.

    TCP_TABLE_OWNER_PID_CONNECTIONS

.

    TCP_TABLE_OWNER_MODULE_CONNECTIONS

.

  TCP_TABLE_CLASS = (TCP_TABLE_BASIC_LISTENER,TCP_TABLE_BASIC_CONNECTIONS,

.

            TCP_TABLE_OWNER_PID_CONNECTIONS,TCP_TABLE_OWNER_PID_ALL,

.

            TCP_TABLE_OWNER_MODULE_LISTENER,TCP_TABLE_OWNER_MODULE_CONNECTIONS,

.

TCP_TABLE_BASIC_CONNECTIONS

.

A MIB_TCPTABLE table that contains all connected TCP endpoints on the machine is returned to the caller.

.

TCP_TABLE_OWNER_PID_CONNECTIONS

.

A MIB_TCPTABLE_OWNER_PID or MIB_TCP6TABLE_OWNER_PID that all connected TCP endpoints on the machine is returned to the caller.

.

TCP_TABLE_OWNER_MODULE_CONNECTIONS

.

A MIB_TCPTABLE_OWNER_MODULE or MIB_TCP6TABLE_OWNER_MODULE that contains all connected TCP endpoints on the machine is returned to the caller.

.
Summary
.

   public int ConnectionIndex;

.

   ULONG ConnectionIndex;

.

   Request.ConnectionIndex = PortPortNumber;

.

   if (DeviceIoControl(h, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, ptrRequest, nBytes, ptrRequest, nBytes, out nBytesReturned, IntPtr.Zero))

.
Summary
Used by DeviceIoControl and IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION to get the Device Descriptor of a device on a port on a USB Hub
.

Is often used as a type inside a USB_NODE_CONNECTION_INFORMATION_EX structure, hence the need for the "Pack=1"

.
Summary
Used with DeviceIoControl and IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME to get the "Driver Key Name" of a device on a USB Hub
.

struct USB_NODE_CONNECTION_DRIVERKEY_NAME

.

   public int ConnectionIndex;

.

Structure USB_NODE_CONNECTION_DRIVERKEY_NAME

.

Identical to the USB_NODE_CONNECTION_NAME structure

.

typedef struct _USB_NODE_CONNECTION_DRIVERKEY_NAME {

.

   ULONG  ConnectionIndex;

.

} USB_NODE_CONNECTION_DRIVERKEY_NAME, *PUSB_NODE_CONNECTION_DRIVERKEY_NAME;

.
Documentation
[USB_NODE_CONNECTION_DRIVERKEY_NAME] on MSDN
.

   USB_NODE_CONNECTION_DRIVERKEY_NAME DriverKey = new USB_NODE_CONNECTION_DRIVERKEY_NAME();

.

   DriverKey.ConnectionIndex = PortPortNumber;

.

   if (DeviceIoControl(h, IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, ptrDriverKey, nBytes, ptrDriverKey, nBytes, out nBytesReturned, IntPtr.Zero))

.

     DriverKey = (USB_NODE_CONNECTION_DRIVERKEY_NAME)Marshal.PtrToStructure(ptrDriverKey, typeof(USB_NODE_CONNECTION_DRIVERKEY_NAME));

.
Summary
Used with DeviceIoControl and IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX to retrieve information about a port connection on a USB Hub
.

struct USB_NODE_CONNECTION_INFORMATION_EX

.

   public int ConnectionIndex;

.

   public int ConnectionStatus;

.

Structure USB_NODE_CONNECTION_INFORMATION_EX

.

typedef struct _USB_NODE_CONNECTION_INFORMATION_EX {

.

   ULONG  ConnectionIndex;

.

   USB_CONNECTION_STATUS  ConnectionStatus;

.

} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX;

.
Documentation
[USB_NODE_CONNECTION_INFORMATION_EX] on MSDN
.

   int nBytes = Marshal.SizeOf(typeof(USB_NODE_CONNECTION_INFORMATION_EX));

.

   IntPtr ptrNodeConnection = Marshal.AllocHGlobal(nBytes);

.

     USB_NODE_CONNECTION_INFORMATION_EX NodeConnection = new USB_NODE_CONNECTION_INFORMATION_EX();

.

     NodeConnection.ConnectionIndex = i;

.

     Marshal.StructureToPtr(NodeConnection, ptrNodeConnection, true);

.

     if (DeviceIoControl(h, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, ptrNodeConnection, nBytes, ptrNodeConnection, nBytes, out nBytesReturned, IntPtr.Zero))

.

       NodeConnection = (USB_NODE_CONNECTION_INFORMATION_EX)Marshal.PtrToStructure(ptrNodeConnection, typeof(USB_NODE_CONNECTION_INFORMATION_EX));

.

   Marshal.FreeHGlobal(ptrNodeConnection);

.

   USB_NODE_CONNECTION_INFORMATION_EX connection = new USB_NODE_CONNECTION_INFORMATION_EX();

.

   connection.ConnectionIndex = i;

.

   size = Marshal.SizeOf(typeof(USB_NODE_CONNECTION_INFORMATION_EX)) + 32 * Marshal.SizeOf(typeof(USB_PIPE_INFO)); // Assuming 32 should be enough, you can make this larger

.

   IntPtr ptr_connection = Marshal.AllocHGlobal(size);

.

   Marshal.StructureToPtr(connection, ptr_connection, true);

.

   if (DeviceIoControl(hHub, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, ptr_connection, size, ptr_connection, size, out bytes_returned, IntPtr.Zero))

.

     connection = (USB_NODE_CONNECTION_INFORMATION_EX)Marshal.PtrToStructure(ptr_connection, typeof(USB_NODE_CONNECTION_INFORMATION_EX));

.

     if (bytes_returned != Marshal.SizeOf(typeof(USB_NODE_CONNECTION_INFORMATION_EX)))

.

       int num = (bytes_returned - Marshal.SizeOf(typeof(USB_NODE_CONNECTION_INFORMATION_EX))) / Marshal.SizeOf(typeof(USB_PIPE_INFO));

.

     IntPtr ptr_pipeinfo = new IntPtr((byte*)ptr_connection.ToPointer()

.

                       + Marshal.SizeOf(typeof(USB_NODE_CONNECTION_INFORMATION_EX))

.

   Marshal.FreeHGlobal(ptr_connection);

.
Summary
Used with DeviceIoControl and IOCTL_USB_GET_NODE_CONNECTION_NAME to get the Device Path of a downstream Hub
.

struct USB_NODE_CONNECTION_NAME

.

   public int ConnectionIndex;

.

Structure USB_NODE_CONNECTION_NAME

.

typedef struct _USB_NODE_CONNECTION_NAME {

.

   ULONG  ConnectionIndex;

.

} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME;

.
Documentation
[USB_NODE_CONNECTION_NAME] on MSDN
.

   USB_NODE_CONNECTION_NAME NodeName = new USB_NODE_CONNECTION_NAME();

.

   NodeName.ConnectionIndex = PortPortNumber;

.

   if (DeviceIoControl(h, IOCTL_USB_GET_NODE_CONNECTION_NAME, ptrNodeName, nBytes, ptrNodeName, nBytes, out nBytesReturned, IntPtr.Zero))

.

     NodeName = (USB_NODE_CONNECTION_NAME)Marshal.PtrToStructure(ptrNodeName, typeof(USB_NODE_CONNECTION_NAME));

.
Summary
Used with DeviceIoControl and IOCTL_USB_GET_NODE_INFORMATION to get connection-related information about a port on a USB Hub
.

You don't use an IOCTL call directly with a USB_STRING_DESCRIPTOR structure. Instead you use a USB_DESCRIPTOR_REQUEST "request packet" with IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION. The USB_STRING_DESCRIPTOR structure is returned at the very end of the request packet. The whole idea of "writing off the edge" of a structure is counter to the way C#/VB.Net was designed to work, so you'll have to make sure to allocate sufficient amount of memory to handle both the "request packet" and the USB_STRING_DESCRIPTOR structure.

.

   Request.ConnectionIndex = PortPortNumber;

.

   if (DeviceIoControl(h, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, ptrRequest, nBytes, ptrRequest, nBytes, out nBytesReturned, IntPtr.Zero))

.

        Byte[] ConnectState;

.

        System.Runtime.InteropServices.ComTypes.FILETIME ConnectTime;

.

        System.Runtime.InteropServices.ComTypes.FILETIME DisconnectTime;

.
Summary
Contains association attributes for a connection.
.
Summary
Defines the attributes of a wireless connection.
.

        public struct WLAN_CONNECTION_ATTRIBUTES

.

        /// WLAN_CONNECTION_MODE->_WLAN_CONNECTION_MODE

.

        public WLAN_CONNECTION_MODE wlanConnectionMode;

.

     Public Structure WLAN_CONNECTION_ATTRIBUTES

.

     ''' WLAN_CONNECTION_MODE->_WLAN_CONNECTION_MODE

.

     Public wlanConnectionMode As WLAN_CONNECTION_MODE

.

WLAN_CONNECTION_MODE

.
Documentation
[WLAN_CONNECTION_ATTRIBUTES] on MSDN
.

public struct WLAN_CONNECTION_PARAMETERS

.

        public WLAN_CONNECTION_MODE wlanConnectionMode;

.

Structure WLAN_CONNECTION_PARAMETERS

.

WLAN_CONNECTION_MODE

.

The rationale behind the change in the history for this is because is that he/she wanted to "unmarshal". However, in functions like WlanConnect(), it is used as an "input". So, it needs to be marshaled. Then I believe they should be IntPtr.

.
Documentation
[WLAN_CONNECTION_PARAMETERS] on MSDN
.

public struct WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS

.

Structure WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS

.
Documentation
[WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS] on MSDN
.

        wlan_notification_acm_connection_start,

.

        wlan_notification_acm_connection_complete,

.

        wlan_notification_acm_connection_attempt_fail,

.

        wlan_notification_acm_disconnecting,

.

        wlan_notification_acm_disconnected,

.

        wlan_notification_acm_connection_start

.

        wlan_notification_acm_connection_complete

.

        wlan_notification_acm_connection_attempt_fail

.

        wlan_notification_acm_disconnecting

.

        wlan_notification_acm_disconnected

.

        wlan_notification_msm_connected,

.

        wlan_notification_msm_disconnected,

.
Summary
Defines the security attributes for a wireless connection.
.

        public WTS_CONNECTSTATE_CLASS State;

wininet

.

hConnect (in) A handle returned from a call to InternetConnect.

.

fExpectResponse (in) A Boolean value that indicates whether the application expects a data connection to be established by the FTP server. This must be set to TRUE if a data connection is expected, or FALSE otherwise.

.

Dim ret As Boolean = FTPCommandA(ConnectionHandle, False, 0, sCommand, IntPtr.Zero, IntPtr.Zero)

.

static extern bool FtpCreateDirectory(IntPtr hConnect, string lpszDirectory);

.

  Private Shared Function FtpCreateDirectory(ByVal hConnect As IntPtr, ByVal lpszDirectory As String) As Boolean

.

static extern bool FtpDeleteFile(IntPtr hConnect, string fileName);

.

   (ByVal hConnect As IntPtr, ByVal fileName As String) _

.

   static extern IntPtr FtpFindFirstFile(IntPtr hConnect,

.

   (ByVal hConnect As IntPtr, ByVal searchFile As String, _

.

static extern bool FtpGetCurrentDirectory(IntPtr hConnect,

.

   (ByVal hConnect As IntPtr, ByVal directory As StringBuilder, ByRef bufferLength As Integer) _

.

' and Me.hINetConn is an IntPtr opened by InternetConnect

.

static extern bool FtpGetFile(IntPtr hConnect, string remoteFile,

.

Declare Function FtpGetFile Lib "wininet.dll" (ByVal hConnect As IntPtr, _

.

    [DllImport("wininet.dll", EntryPoint = "InternetConnectW", CharSet = CharSet.Auto, SetLastError = true)]

.

    private static extern IntPtr InternetConnectW(

.

    public void Connect()

.

        ftpHandle = InternetConnectW(internetHandle, FTPSite,

.

    public void Disconnect()

.

        Connect();

.

        Connect();

.

        Disconnect();

.

static extern bool FtpPutFile(IntPtr hConnect, string lpszLocalFile, string lpszNewRemoteFile, int dwFlags, IntPtr dwContext);

.

Call InternetOpen() and InternetConnect() to get a valid hConnect handle.

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: