Network.getProxySettings 方法
getProxySettings 方法检索给定协议的代理设置。
语法
retVal = Network.getProxySettings(
protocol
)
参数
-
协议 [in]
-
指定协议名称的字符串。 有关支持的协议的列表,请参阅 支持的协议和文件类型。
返回值
此方法 返回包含下列 值之一的数字 (长) 。
Value | 说明 |
---|---|
0 | 未使用代理服务器。 |
1 | 当前浏览器的代理设置仅用于 HTTP) (。 |
2 | 正在使用手动指定的代理设置。 |
3 | 正在自动检测代理设置。 |
注解
除非调用应用程序在本地计算机或 Intranet 上运行,否则此方法将失败。
Windows 媒体播放器 10 移动版:不支持此方法。
示例
以下JScript示例使用网络。getProxySettings 以显示一条消息,该消息在浏览器窗口中提供有关播放器的当前代理设置的信息。 已创建 ID 为“Player”的 Player 对象。
// Retrieve a number representing the current proxy settings.
var proxySetting = Player.network.getProxySettings("MMS");
// Display the message the corresponds to the current settings.
switch(proxySetting){
case 0:
document.write("A proxy server is not being used");
break;
case 1:
document.write("The proxy settings for the current browser are being used.");
break;
case 2:
document.write("The manually specified proxy settings are being used.");
break;
case 3:
document.write("The proxy settings are being auto-detected.");
break;
default:
document.write("Unable to determine proxy setting, try again.");
}
要求
要求 | Value |
---|---|
版本 |
Windows 媒体播放器版本 7.0 或更高版本。 |
DLL |
|