語言

URLConnection.ContentLength 屬性

定義

回傳標頭欄位的 content-length 值。

public virtual int ContentLength { [Android.Runtime.Register("getContentLength", "()I", "GetGetContentLengthHandler")] get; }
[<get: Android.Runtime.Register("getContentLength", "()I", "GetGetContentLengthHandler")>]
member this.ContentLength : int

屬性值

若該連結的 URL 所參考資源內容長度未知,或內容長度大於 Integer.MAX_VALUE,則為該連結所參考 -1 的資源內容長度。

屬性

備註

回傳標頭欄位的 content-length 值。

<B>Note</B>: #getContentLengthLong() getContentLengthLong() 應該比此方法更為優越,因為它回傳 a long 且較為便攜。

的 java.net.URLConnection.getContentLength()Java 檔。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於