请告诉我如何使用 C# 或 DOS 连接和断开移动宽带连接?
最佳答案
在命令行 (DOS) 上,您可以使用 netsh 命令。
说明: 1)获取手机界面,记下名字
netsh mbn show interface
输出:
There is 1 interface on the system:
Name : Mobiel 5
Description : Sierra Wireless EM7345 4G LTE
GUID : xxx
Physical Address : xxx
State : Not connected
Device type : Mobile Broadband device is embedded in the system
Cellular class : GSM
Device Id : xxx
Manufacturer : Sierra Wireless Inc.
Model : Sierra Wireless EM7345 4G LTE
Firmware Version : FIH7160_V1.2_WW_01.1442.11
Provider Name : BEL PROXIMUS
Roaming : Yes
Signal : 74%
RSSI / RSCP : 23 (-67 dBm)
2) 获取接口(interface)的连接配置文件(在我的系统上名称是“mobiel 5”
netsh mbn show profiles interface="mobiel 5"
输出
Profiles on interface Mobiel 5:
-------------------------------------
{3623E7AB-E116-47E6-8A9B-FCC1ADBE568E}
{F4E77FAE-D4FD-4196-86CA-852EFE8A9154}
!!##MBIMModemProvisionedContextInternetProfile##8935299564103228197
3) 使用接口(interface)和配置文件名称连接
netsh mbn connect interface="mobiel 5" connmode=name name="{F4E77FAE-D4FD-4196-86CA-852EFE8A9154}"
4) 使用接口(interface)名称断开连接
netsh mbn disconnect interface="mobiel 5"
这适用于 Windows 10
关于c# - 连接和断开移动宽带连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8688161/