用代码创建连接"PPPOE”

 ZeroMemory(lpRasEntry, sizeof(RASENTRY));


 lpRasEntry->dwSize = dwBufferSize;
 lpRasEntry->dwfOptions = RASEO_SwCompression|RASEO_RemoteDefaultGateway|RASEO_PreviewUserPw;
 //lpRasEntry->dwType = RASET_Broadband;

 lstrcpy(lpRasEntry->szDeviceType, RASDT_PPPoE);
 //lstrcpy(lpRasEntry->szDeviceName, L"pppoe");
 lstrcpy(lpRasEntry->szDeviceName, L"PPPoE Line 0");
 lpRasEntry->dwfNetProtocols = RASNP_Ip;
 lpRasEntry->dwFramingProtocol = RASFP_Ppp;

 

 // 创建连接

 dwRet = RasSetEntryProperties(NULL, L"pppoe", lpRasEntry, dwBufferSize, NULL, 0);

你可能感兴趣的:(用代码创建连接"PPPOE”)