更新:2007 年 11 月
获取或设置配置文件服务超时值。
说明: |
|---|
若要获取或设置客户端 API 属性的属性值,必须调用以 get_ 和 set_ 为名称前缀的属性访问器方法。例如,若要获取或设置属性 cancel 的值,需要调用 get_cancel 或 set_cancel 方法。 |
Sys.Services.ProfileService.set_timeout(value);
var profTimeout = Sys.Services.ProfileService.get_timeout();
参数
参数 |
说明 |
|---|---|
value |
超时值(以毫秒为单位)。 |
备注
timeout 属性表示 Sys.Net.WebRequestExecutor 类的当前实例在请求超时之前应等待的时间(以毫秒为单位)。
说明: |
|---|
通过设置超时时间间隔,可确保挂起的请求根据您指定的时间间隔返回,而不是等待异步通信层超时。 |
示例
下面的示例演示如何使用 timeout 属性。此代码摘自 Sys.Services.ProfileService 类概述中的一个完整示例。
// Get the profile service timeout
var timeout = Sys.Services.ProfileService.get_timeout();
请参见
概念
Sys.Services.AuthenticationService 类
说明: