Network.setProxyName 方法
setProxyName 方法指定要使用的代理服务器的名称。
语法
Network.setProxyName(
protocol,
name
)
参数
-
协议 [in]
-
指定协议名称的字符串。 有关受支持的协议的列表,请参阅 支持的协议和文件类型。
-
name [in]
-
指定要使用的代理服务器名称的字符串。
返回值
此方法不返回值。
注解
除非 getProxySettings 返回值 2 (使用手动设置) ,否则此方法不起作用。
除非调用应用程序在本地计算机或 Intranet 上运行,否则此方法将失败。
Windows 媒体播放器 10 移动版:不支持此方法。
示例
以下JScript示例使用网络。setProxyName,指定 MMS 协议Windows 媒体播放器代理服务器的名称。 从 ID 为“NAME”的 HTML TEXT 元素检索新名称。 玩家对象是使用 ID = “ Player ” 创建的。
// Test whether proxy settings are manual.
if (Player.network.getProxySettings("MMS") == 2){
// Store the new proxy server name specified by the user.
var proxyname = NAME.value;
// Set the proxy server name.
Player.network.setProxyName("MMS", proxyname);
}
else
// Warn that proxy settings must be set to 2.
alert("Proxy settings must be manual!");
要求
要求 | 值 |
---|---|
版本 |
Windows 媒体播放器 7.0 或更高版本。 |
DLL |
|