gpt4 book ai didi

c# - 为什么这些参数不起作用?

转载 作者:行者123 更新时间:2023-11-30 20:05:41 26 4
gpt4 key购买 nike

public static string ChangeDeviceState(int deviceID, DeviceState nextState)
{
bool temp1;
string temp = "";
return ChangeDeviceState(deviceID, nextState, temp1, temp, "", "", "", "", "");
}

public static string ChangeDeviceState(int deviceID, DeviceState nextState, out bool? isAccessToken, out String challengeOrToken, string accessToken, string serialNumber, string MACAddress, string deviceModel, string answer )
{

我想要做的就是使用另一种不需要其他参数的方法。 I bool isAccessToken 必须可以为空,challengeOrToken 必须是输出参数。

我收到非法参数错误。

c#中的这些参数特性,我实在是看不懂。任何帮助是极大的赞赏。

最佳答案

您不包括 out在需要时调用参数并且 temp1 不是 nullable boolean ( bool 值?)。

public static string ChangeDeviceState(int deviceID, DeviceState nextState)
{
bool? temp1;
string temp;
return ChangeDeviceState(deviceID, nextState, out temp1, out temp, "", "", "", "", "");
}

关于c# - 为什么这些参数不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10942167/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com