4

enter image description here

Description :

I created a Dial-Up Connection Programatically to commnunicate with my device and the Laptop. And once the connection is established with the Dial-Up connection Created, My internet connection which is connected via LAN is not working and the status of my LAN connection ( used for internet connection remains ) connected.

To over come this I need to un-check the "Use Defualt Gate Way on Remote Network", option by, right click my dial-up connection -> properties -> Netwroking TAB -> Select Internet Protocol (TCP/IP) -> Properties -> Advanced -> I get Advanced TCP/IP settings -> Unchek "Use Default Gate Way on Remote Network".

I am using RAS functions to create a Phonebook for my dial-up connection. Is there any structures available to make this as an option. I didnd found any structure parameters to make this as an option. Please advice..

How to to this programatically? Can I use any APIs.

4

3 に答える 3

3

私はそれを検証するためにテストしていませんが、これは構造のForwardingEnabled要素に対応していると思います. MIB_IPINTERFACE_ROWその場合は、 で変更できますSetIpInterfaceEntry

通常、 を呼び出しGetIpInterfaceTableて各インターフェイスの現在の情報を取得しForwardingEnabled、正しいメンバーのメンバーを変更してSetIpInterfaceEntryから、その変更された を呼び出しますMIB_IPINTERFACE_ROW

于 2012-07-31T13:54:17.633 に答える
1

電話帳の作成中にフラグを設定解除すると、RASEO_RemoteDefaultGatewayこのオプションが無効になります。

このフラグは、 RASENTRY構造体dwoptionsメンバーを使用して Unset にすることができます。

Microsoft SDK のコンテンツ:

RASEO_RemoteDefaultGateway- このフラグが設定されている場合、接続がアクティブな場合、IP パケットの既定のルートはダイヤルアップ アダプターを経由します。このフラグがオフの場合、デフォルト ルートは変更されません。このフラグは、[TCP/IP 設定] ダイアログ ボックスの [リモート ネットワークでデフォルト ゲートウェイを使用する] チェック ボックスに対応しています。

于 2012-08-09T08:17:53.097 に答える
0

AdvertiseDefaultRouteフラグとDisableDefaultRoutesフラグに賭けます。デフォルト ゲートウェイを使用するオプションは、単に現在のゲートウェイを上書きし、デフォルト ルートを変更します (route print接続の前後を確認してください)。

于 2012-08-09T06:32:31.473 に答える