创建一个没有对话框的新电话簿条目

时间:2012-06-25 05:23:01

标签: c# .net windows winapi visual-c++

我发现RasCreatePhonebookEntry创建了一个电话簿条目,但在SDK中它被称为

  

“自Windows Vista及其版本起,此功能已被弃用   功能已被RasDialDlg“

取代

那么有没有其他方法可以创建一个新的电话簿条目,而不向所有版本的Windows支持的用户提供支持?

如果RasCreatePhonebookEntry本身可以用于所有版本的Windows来创建新的电话簿条目,那么如何使用“Preferred COM port”结构设置“RASENTRY”选项的值?我没有在RASENTRY STRUCTURE中找到任何参数来设置首选端口..

我想在电话簿中设置以下参数:

PreferredPort=COM31
PreferredDevice=Communications cable between two computers #5

MEDIA=serial
Port=COM10
Device=Communications cable between two computers #5
ConnectBPS=460800

如何通过在电话簿中创建新条目来以编程方式设置上述参数。

更新

Fianlly我使用RasGetEntryProperties"RasSetEntryProperties"创建了一个Ras电话簿,但我面临的唯一问题是"DeviceName" "RASEntry" structure。仅当我将DeviceName设为"Communications cable between two computers #13".

时,它才有效

我尝试枚举“RasEnumDevices”,但我正在获取设备列表。

WAN Miniport (L2TP)
WAN Miniport (L2TP)
WAN Miniport (PPTP)
WAN Miniport (PPTP)
WAN Miniport (PPPOE)
Communications cable between two computers #14
Communications cable between two computers #13

如何从中选择我的设备?

0 个答案:

没有答案