Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 继续下一行中的代码_C#_.net - Fatal编程技术网

C# 继续下一行中的代码

C# 继续下一行中的代码,c#,.net,C#,.net,上述格式不起作用。表示无效表达式“| |” C#中的if语句需要完全包含在一组括号中。在两个|ed表达式周围添加另一个集合,即使在两行上也可以正常工作 if (some condition) || (some other condition) { // do something } 您的if语句缺少外圆括号。e、 g if ((some condition) || (some other condition)) { // do something } 您的括号已关闭,

上述格式不起作用。表示
无效表达式“| |”

C#中的if语句需要完全包含在一组括号中。在两个
|
ed表达式周围添加另一个集合,即使在两行上也可以正常工作

if (some condition) || 
(some other condition)
{
   // do something
}

您的
if
语句缺少外圆括号。e、 g

if ((some condition) ||
    (some other condition))
{
    // do something
}

您的括号已关闭,应为:

if ((some condition) || (some other condition))
{ 
   // do something 
}
if ((some condition) || 
(some other condition))
{
   // do something
}