[英]How can i pass parameter to this method
這是方法:
getUsersList(ref List<RealBioSDKUser> userList,
int groupId = -1,
[DateTimeConstant(0), Optional] DateTime fromDate)
當我傳遞這樣的參數時:
List<RealBioSDKUser> tempUserList=new List<RealBioSDKUser>();
BioClient.getUsersList(ref tempUserList,0, "1900-01-01");
顯示此錯誤:
像這樣的collections.generic.list的最佳重載方法匹配。
因為"1900-01-01"
是字符串,而不是DateTime
。 改為傳遞DateTime
對象:
BioClient.getUsersList(ref tempUserList,0, new DateTime(1900, 1, 1));
調用時,請提供DateTime
實例(即new DateTime(1900, 1, 1)
)實例,而不是String
( "1900-01-01"
)實例:
getUsersList(ref List<RealBioSDKUser> userList,
int groupId = -1,
[DateTimeConstant(0), Optional] DateTime fromDate) // <- DateTime
...
List<RealBioSDKUser> tempUserList = new List<RealBioSDKUser>();
BioClient.getUsersList(ref tempUserList, 0, new DateTime(1900, 1, 1)); // <- DateTime
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.