更新时间:2022-06-22 09:31:59
由于无益,因为这可能是,AFAIK有没有办法来解决它与泛型。
As unhelpful as this may be, AFAIK there's no way to get around it with generics.
为什么不直接用对象
工作?它是一个性能问题?
Why not just work with Object
? Is it a performance issue?
Public Shared Function GetQueryStringValue(ByVal queryStringVariable As String, ByVal t As Type) As Object
Dim queryStringObject As Object = Nothing
If queryStringVariable <> Nothing Then
If HttpContext.Current.Request.QueryString(queryStringVariable) IsNot Nothing Then
queryStringObject = CTypeDynamic(queryStringVariable, t)
End If
End If
Return queryStringObject
End Function