質問

We are working in project where we have done lots of versions (SVN) and many people working on it. Our client raised issue, which we have already fixed in code someday back. So I wanted to figure out, if we have sent correct build at client site. After checking lot many things, I found it is easiest to reverse code on Client side to see actual code. So I did it using Reflector.

VB.Net code,

Case RequestState.FirstComplete 'RequestState.FirstComplete = 2
Request.Time = Now

If ErrorCode = ProcessErrors.NONE OrElse ProcessErrors.SUBSCRIBER_BUSY_FOR_MT_SMS Then
'OrElse ErrorCode = ProcessErrors.EQUIPMENT_PROTOCOL_ERROR

NextStep(Id, GetDPC(id), NUMBER)

Reversed code,

case 2:
{
  request.Time = DateAndTime.Now;
  if (errorCode == 0)
  {

  }

  NextStep(invokeId, ref GetDPC(id), ref NUMBER);    
}

Now I am not able to understand this oversimplification. How come,

If ErrorCode = ProcessErrors.NONE OrElse ProcessErrors.SUBSCRIBER_BUSY_FOR_MT_SMS Then

Becomes,

if (errorCode == 0)
{
}
役に立ちましたか?

解決

Because your original code is incorrect.

It should be

If ErrorCode = ProcessErrors.NONE OrElse ErrorCode = ProcessErrors.SUBSCRIBER_BUSY_FOR_MT_SMS Then
                                         ^^^^^^^^^^^^

You can't use OrElse to test if some value (ErrorCode) is one of two other values.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top