答案 0 :(得分:3)
没有返回匿名类型。
答案 1 :(得分:3)
返回anonymous type(VB.NET参考)。它是一种没有相应类的类型。
Visual Basic支持匿名类型,使您无需为数据类型编写类定义即可创建对象。相反,编译器会为您生成一个类。该类没有可用的名称,直接从Object继承,并包含您在声明对象时指定的属性。由于未指定数据类型的名称,因此将其称为匿名类型。
答案 2 :(得分:3)
答案 3 :(得分:1)
返回具有以下属性的匿名类型(不是数组):percentComplete,message,fileName和downloadBytes。
答案 4 :(得分:1)
转换为VB可能对您有所帮助:
<System.Web.Services.WebMethod> _
<System.Web.Script.Services.ScriptMethod> _
Public Shared Function GetUploadStatus() As Object
Dim info As UploadDetail = DirectCast(HttpContext.Current.Session("UploadDetail"), UploadDetail)
If info IsNot Nothing AndAlso info.IsReady Then
Dim soFar As Integer = info.UploadedLength
Dim total As Integer = info.ContentLength
Dim percentComplete As Integer = CInt(Math.Ceiling(CDbl(soFar) / CDbl(total) * 100))
Dim message As String = "Uploading..."
Dim fileName As String = String.Format("{0}", info.FileName)
Dim downloadBytes As String = String.Format("{0} of {1} Bytes", soFar, total)
Return New With { _
Key .percentComplete = percentComplete, _
Key .message = message, _
Key .fileName = fileName, _
Key .downloadBytes = downloadBytes _
}
End If
Return Nothing
End Function
答案 5 :(得分:0)
答案 6 :(得分:0)