/// <summary> /// 检查网络连接类型。 /// </summary> /// <returns>返回一个 <see cref="InternetConnectionType"/>。</returns> public static InternetConnectionType CheckInternetConnectionType() { InternetConnectionType connectionType = InternetConnectionType.NoConnection; ConnectionProfile InternetConnectionProfile = NetworkInformation.GetInternetConnectionProfile(); if (InternetConnectionProfile != null) { if (InternetConnectionProfile.IsWwanConnectionProfile) { connectionType = InternetConnectionType.WwanConnection; } else if (InternetConnectionProfile.IsWlanConnectionProfile) { connectionType = InternetConnectionType.WlanConnection; } } return(connectionType); }
/// <summary> /// Initializes a new instance of the <see cref="T:NetworkChangedEventArgs" /> class. /// </summary> /// <param name="isConnected">set to <c>true</c> if an Internet connection is available.</param> public NetworkChangedEventArgs(bool isConnected, InternetConnectionType connectionType = InternetConnectionType.Unknown) { this.IsConnected = isConnected; this.ConnectionType = connectionType; }
public void Internet_Setup_Connection_Profile(int ProfileID, InternetConnectionType type, string APN, string username, string password) { InternetConnectionProfile p = new InternetConnectionProfile(ProfileID, type); p.user = username; p.passwd = password; p.apn = APN; Internet_Setup_Connection_Profile(p); }
public void Internet_Setup_Connection_Profile(InternetConnectionType type, string APN, string username, string password) { Internet_Setup_Connection_Profile(0, type, APN, username, password); }
/// <summary> /// if CSD calledNum and dataType also required /// </summary> /// <param name="ProfileID"></param> /// <param name="conType"></param> public InternetConnectionProfile(int ProfileID, InternetConnectionType conType) { this.profileID = ProfileID; this.conType = conType; user = passwd = apn = inactTO = calledNum = dataType = dns1 = dns2 = alphabet = ""; }
public static string GetInternetConnectionString(InternetConnectionType type) { switch (type) { case InternetConnectionType.CSD: return "CSD"; case InternetConnectionType.GPRS0: return "GPRS0"; default: return "none"; } }