Network.setProxyPort 方法
[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 如果可能,Microsoft 强烈建议新代码使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]
setProxyPort 方法指定要使用的代理端口。
语法
Network.setProxyPort(
protocol,
port
)
参数
-
协议 [in]
-
指定协议名称的字符串。 有关受支持协议的列表,请参阅 支持的协议和文件类型。
-
port [in]
-
数字 (长) 指定要使用的代理端口。
返回值
此方法不返回值。
备注
此方法不起作用,除非 getProxySettings 返回值 2 (使用手动设置) 。
除非调用应用程序在本地计算机或 Intranet 上运行,否则此方法将失败。
Windows 媒体播放器 10 移动版:不支持此方法。
示例
以下 JScript 示例使用网络。setProxyPort 指定 MMS 协议的Windows 媒体播放器代理端口号。 端口号是从 ID 为“PORT”的 HTML INPUT 元素中检索的。 创建的 Player 对象 ID 为“Player”。
// Test whether proxy settings are manual.
if (Player.network.getProxySettings("MMS") == 2){
// Store the port number specified by the user.
var portnumber = PORT.value;
// Set the port number for the MMS protocol.
Player.network.setProxyPort("MMS", portnumber);
}
else
// Warn that proxy settings must be set to 2.
alert("Proxy settings must be manual!");
要求
要求 | 值 |
---|---|
版本 |
Windows 媒体播放器版本 7.0 或更高版本。 |
DLL |
|
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈