M
Milsnips
Hi there,
i've tried and tried and just cannot get this working, i want to create a
function in c# that calls the RasEnumConnections and loop through the items,
when i find the one i'm after, then i call RasHangUp on it to disconnect it.
This is what i have so far (sorry if any mistakes here, this is my first
real attempt at API calls)...:
--------------------------------------------------------------
[DllImport("coredll.dll")]
private static extern int RasEnumConnections(ref RASCONN[] lprasconn, ref
uint lpcb, ref UIntPtr lpcConnections);
[DllImport("coredll.dll")]
private static extern int RasHangUp(string session); //not sure here so so i
put string, but i think it needs a handle.
[StructLayout(LayoutKind.Sequential)]
public struct RASCONN
{
public uint dwSize;
public UIntPtr hrasconn;
public string szEntryName;
}
--------------------------------------------------------------
......the rest i'm not too sure of in how to initialize it all and make the
API call to RasEnumConnections....
Any help with source code examples would be reeeallly appreciated )
thanks in advance,
Paul
i've tried and tried and just cannot get this working, i want to create a
function in c# that calls the RasEnumConnections and loop through the items,
when i find the one i'm after, then i call RasHangUp on it to disconnect it.
This is what i have so far (sorry if any mistakes here, this is my first
real attempt at API calls)...:
--------------------------------------------------------------
[DllImport("coredll.dll")]
private static extern int RasEnumConnections(ref RASCONN[] lprasconn, ref
uint lpcb, ref UIntPtr lpcConnections);
[DllImport("coredll.dll")]
private static extern int RasHangUp(string session); //not sure here so so i
put string, but i think it needs a handle.
[StructLayout(LayoutKind.Sequential)]
public struct RASCONN
{
public uint dwSize;
public UIntPtr hrasconn;
public string szEntryName;
}
--------------------------------------------------------------
......the rest i'm not too sure of in how to initialize it all and make the
API call to RasEnumConnections....
Any help with source code examples would be reeeallly appreciated )
thanks in advance,
Paul