Click here to Skip to main content
15,910,878 members
Home / Discussions / C#
   

C#

 
GeneralIcons in Task bar Pin
sommarafton3-Nov-04 4:29
sommarafton3-Nov-04 4:29 
GeneralRe: Icons in Task bar Pin
Alex Korchemniy3-Nov-04 8:14
Alex Korchemniy3-Nov-04 8:14 
GeneralDetect "Minimize" and "Autostart" Pin
Stefan Troschuetz3-Nov-04 3:25
Stefan Troschuetz3-Nov-04 3:25 
GeneralRe: Detect "Minimize" and "Autostart" Pin
Nick Parker3-Nov-04 4:40
protectorNick Parker3-Nov-04 4:40 
GeneralRe: Detect "Minimize" and "Autostart" Pin
Stefan Troschuetz3-Nov-04 4:49
Stefan Troschuetz3-Nov-04 4:49 
GeneralRe: Detect "Minimize" and "Autostart" Pin
Christian Pedersen3-Nov-04 5:04
Christian Pedersen3-Nov-04 5:04 
GeneralRe: Detect "Minimize" and "Autostart" Pin
Stefan Troschuetz3-Nov-04 22:54
Stefan Troschuetz3-Nov-04 22:54 
Generalretrive single fieald form database Pin
webhay3-Nov-04 3:12
webhay3-Nov-04 3:12 
GeneralRe: retrive single fieald form database Pin
Looney Tunezez3-Nov-04 7:19
Looney Tunezez3-Nov-04 7:19 
GeneralRe: retrive single fieald form database Pin
cnet20083-Nov-04 16:06
cnet20083-Nov-04 16:06 
GeneralRe: retrive single fieald form database Pin
turbochimp5-Nov-04 9:12
turbochimp5-Nov-04 9:12 
Generalinheritance from an interface and base class problem Pin
impeham3-Nov-04 2:13
impeham3-Nov-04 2:13 
GeneralRe: inheritance from an interface and base class problem Pin
Daniel Turini3-Nov-04 2:51
Daniel Turini3-Nov-04 2:51 
GeneralRe: inheritance from an interface and base class problem Pin
impeham3-Nov-04 4:03
impeham3-Nov-04 4:03 
GeneralRe: inheritance from an interface and base class problem Pin
sreejith ss nair3-Nov-04 3:06
sreejith ss nair3-Nov-04 3:06 
QuestionUPNP anyone? Pin
Assaad Chalhoub3-Nov-04 1:42
Assaad Chalhoub3-Nov-04 1:42 
AnswerRe: UPNP anyone? Pin
sreejith ss nair3-Nov-04 3:10
sreejith ss nair3-Nov-04 3:10 
QuestionHow to use "RasGetProjectionInfo" in C#??? Pin
hailei3-Nov-04 0:55
hailei3-Nov-04 0:55 
AnswerRe: How to use "RasGetProjectionInfo" in C#??? Pin
Alex Korchemniy3-Nov-04 8:08
Alex Korchemniy3-Nov-04 8:08 
GeneralRe: How to use "RasGetProjectionInfo" in C#??? Pin
hailei3-Nov-04 14:27
hailei3-Nov-04 14:27 
GeneralRe: How to use "RasGetProjectionInfo" in C#??? Pin
Alex Korchemniy3-Nov-04 15:32
Alex Korchemniy3-Nov-04 15:32 
AnswerRe: How to use "RasGetProjectionInfo" in C#??? Pin
Marcco13-Jan-05 5:57
Marcco13-Jan-05 5:57 
Hello all, when I tried the solution as it was posted it did not work for me Frown | :( I am trying to call RasGetProjectionInfo by Pinvoking the rasapi32.dll on WinXP. I have no problem connecting to my RAS server but When I pass it back the appropriate params and structures I get back empty strings for szIpAddress and szServerIpAddress or if I modify my code to CharSet=CharSet.Unicode I get nulls.. ( listed below is the code )

Any help would be appreciated.., Thanks Smile | :)

[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Auto)]
public class RASPPPIP
{
public uint dwSize = 72;
public uint dwError;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)]
public string szIpAddress;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)]
public string szServerIpAddress;
}

public enum RASPROJECTION:uint
{
RASP_AMB = 0x10000,
RASP_PppNbf = 0x803F,
RASP_PppIpx = 0x802B,
RASP_PppIp = 0x8021,
RASP_PppCcp = 0x80FD,
RASP_PppLcp = 0xC021,
RASP_Slip = 0x20000

}
[DllImport("rasapi32.dll",CharSet=CharSet.Auto)]
public extern static uint RasGetProjectionInfo(
IntPtr hRasConn,
RASPROJECTION projection,
[In,Out] RASPPPIP pppip,
ref uint ppipSize
);



and the calling function ...

public void Dial()
{
if(_Handle!=IntPtr.Zero)
{
RASCONNSTATUS status=new RASCONNSTATUS();
uint res=Ras.RasGetConnectStatus(_Handle,status);

if(res==6) //res=ERROR_INVALID_HANDLE
_Handle=IntPtr.Zero;
else
return;
}
try
{
Ras.RasCheck(Ras.RasDial(null,_Phonebook,_Params,1,_DialNotifyDelegate,ref _Handle));
Ras.RasConnectionNotification(_Handle,this._DisconnEvent.Handle,RASNOTIFICATION.RASCN_Disconnection);
RASPPPIP pppip = new RASPPPIP();
uint size = pppip.dwSize;
uint ipstatus = 0;
ipstatus = Ras.RasGetProjectionInfo(this._Handle,RASPROJECTION.RASP_PppIp,pppip,ref size);
StartWatch();
}
catch(RasException e)
{
OnError(e.ErrorCode,e.Message);
}
}


AnswerRe: How to use "RasGetProjectionInfo" in C#??? Pin
Marcco14-Jan-05 4:32
Marcco14-Jan-05 4:32 
GeneralSharePoint and Active Directory Pin
robmekong3-Nov-04 0:24
robmekong3-Nov-04 0:24 
GeneralGrid problem Pin
babeng3-Nov-04 0:17
babeng3-Nov-04 0:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.