我对c#很陌生,这是一个当前非常基本的Windows窗体来查找一些Autocad变量。我只是试图弄清楚为什么它给了我;在我所有的“if”陈述之后都会有所期待。它必须是非常简单的东西......否则我错了。对IF语句的分号预期
任何帮助,非常感谢。谢谢!
请注意,我已经试过并在每个末尾都没有分号,我仍然得到错误。
private void doneButton_Click(object sender, EventArgs e)
{
int findValue = 0;
//int none = 0;
//int clearAll = 1024;
int endpoint = 1;
int midpoint = 2;
int center = 4;
int node = 8;
int quadrant = 16;
int intersection = 32;
int insertion = 64;
int perpendicular = 128;
int tangent = 256;
int nearest = 512;
int apparentIntersection = 2048;
int extension = 4096;
int parallel = 8192;
if (cbxEndpoint.Checked) {findValue += endpoint};
if (cbxMidpoint.Checked){findValue += midpoint};
if (cbxCenter.Checked){findValue += center};
if (cbxNode.Checked){findValue += node};
if (cbxQuadrant.Checked){findValue += quadrant};
if (cbxIntersection.Checked){findValue += intersection};
if (cbxInsertion.Checked){findValue += insertion};
if (cbxPerpendicular.Checked){findValue += perpendicular};
if (cbxTangent.Checked){findValue += tangent};
if (cbxNearest.Checked){findValue += nearest};
if (cbxApparent.Checked){findValue += apparentIntersection};
if (cbxExtension.Checked){findValue += extension};
if (cbxParallel.Checked){findValue += parallel};
if (cbxNone.Checked){findValue = 0};
System.IO.StreamWriter file = new System.IO.StreamWriter(@"N:\C3D Support\MySettings.txt");
file.WriteLine("OSNAPS," + findValue);
file.Close();
Environment.Exit(0);
}
你太棒了。谢谢你让我觉得自己像个白痴一样。 ; P – smakfactor1
没问题。很高兴帮助...如果你喜欢,请投票并接受答案。 :) – RacerNerd
我没有足够的投票声望。 :( – smakfactor1