public static WlanHostedNetworkReason SetSecondaryKey(byte[] passKey, bool isPersistent = true) { WlanHostedNetworkReason failReason; Helper.ThrowExceptionForHR(WlanNativeMethods.WlanHostedNetworkSetSecondaryKey(wlanHandle, 32, passKey, false, isPersistent, out failReason, IntPtr.Zero)); return(failReason); }
public static WlanHostedNetworkReason SetSecondaryKey(string passKey, bool isPersistent = true) { WlanHostedNetworkReason failReason; Helper.ThrowExceptionForHR(WlanNativeMethods.WlanHostedNetworkSetSecondaryKey(wlanHandle, (uint)(passKey.Length + 1), Encoding.Default.GetBytes(passKey), true, isPersistent, out failReason, IntPtr.Zero)); return(failReason); }