Network.setProxyBypassForLocal 方法

[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 Microsoft 强烈建议新代码尽可能使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]

setProxyBypassForLocal 方法指定一个值,该值指示如果源服务器位于本地网络上,是否绕过代理服务器。

语法

Network.setProxyBypassForLocal(
  protocol,
  bypass
)

参数

协议 [in]

指定协议名称的字符串。 有关支持的协议的列表,请参阅 支持的协议和文件类型

绕过 [in]

指定是否绕过代理服务器的布尔值

返回值

此方法不返回值。

备注

此方法不起作用,除非 getProxySettings 返回值 2 (使用手动设置) 。

除非调用应用程序在本地计算机或 Intranet 上运行,否则此方法失败。

Windows 媒体播放器 10 移动版:不支持此方法。

示例

以下 JScript 示例使用网络setProxyBypassForLocal 用于指定在使用 MMS 协议时是否绕过Windows 媒体播放器代理服务器(如果源服务器位于本地网络上)。 创建 ID 为“Player”的 Player 对象。

// Test whether the proxy settings are manual.
if (Player.network.getProxySettings("MMS") == 2){

   // Prompt the user for a setting. Store the response in a variable.
   var proxybypass = confirm("Bypass proxy server for local addresses? \n OK = Yes \n Cancel = No");

   // Set the proxy bypass value using the user input.
   Player.network.setProxyBypassForLocal("MMS", proxybypass);
}

else

// Warn that proxy settings must be set to 2.
alert("Proxy settings must be manual!");

要求

要求
版本
Windows 媒体播放器版本 7.0 或更高版本。
DLL
Wmp.dll

另请参阅

Network 对象