"stateType"という列挙体があります。私の機能でIFループで列挙を設定する方法
enum stateType : int
{
Unknown = 0,
Active = 1,
Inactive = 2
}
「接続()」私は 列挙「アクティブ」の時にバージョンを表示する必要があります下に示しました。
static private void connction()
{
string hostName = this_event.variableData[0].atr_value;
string policyGuid = this_event.variableData[1].atr_value;
string policyVersion = this_event.variableData[2].atr_value;
string formatVersion = this_event.variableData[3].atr_value;
string enabled = this_event.variableData[4].atr_value;
string Version = "0.0.0.0";
if (this_event.variableData.Length >= 6)
{
Version = this_event.variableData[5].atr_value;
}
}
私は、私は私がエラー演算子「& &は」にすることはできません取得していますこのよう
if (this_event.variableData.Length >= 6 && stateType.Active)
{
Version = this_event.variableData[5].atr_value;
}
をした
if loop(if (this_event.variableData.Length >= 6)&& condition)
に条件を設定する必要があることをどのように行います型 'bool'と 'Spo.SPDlib.SPD.SPD_clientStateType'のオペランドに適用されます。D:\ P \ leaf.cs
あなたは、あなたがそれにアクセスする前の状態を割り当てる必要があることを指摘する何かを持っている必要があります。 –
まあ、 'stateType state'を書いて' state'に何も割り当てなかったので、エラーはすぐに説明されます。しかし、私はあなたがしたいことを本当に理解していません... –
申し訳ありません私は質問を編集しました – peter