Jump to content
Che

va rog ajutor cu o linie de cod in C# !

Recommended Posts

Posted (edited)

Vreau sa creez un proiect in Visual Studio C# decompiland un executabil deja creat si am o problema cu o anume linie de cod care da eroare oricum as scrie-o.

Decompilat cu .Net Reflector, linia de cod arata cam asa:

dictionary.Add(string.Format("Other straght draw - {0} outs", ((Pioeval.StraightDrawType) 4) * type), type != Pioeval.StraightDrawType.None);

Eroarea e aici:

(object) checked (4 * unchecked ((int) straightDrawType)))

Si zice: The name 'straightDrawType' does not exist in the current context.

Daca pun:

Pioeval.StraightDrawType

Imi zice:

'Pioeval.StraightDrawType' is a type, which is not valid in the given context.

Decompilat cu dotPeek, linia de cod arata asa:

dictionary.Add(string.Format("Other straght draw - {0} outs", (object) checked (4 * unchecked ((int) straightDrawType))), straightDrawType != Pioeval.StraightDrawType.None);

la asta eroarea e ca cica '*' cannot be applied to type of operands like 'Pioeval.StraightDrawType'.

Si aici avem fragmentul de cod la care face referire:

Public Enum StraightDrawType

' Fields

EightOutStraightDraw = 2

FourOutStraightDraw = 1

None = 0

End Enum

Cum se scrie corect linia de cod ?

Multumesc mult !

LE:

Am uitat, este si o variabila locala denumita 'type' in cadrul acelei functii:

Pioeval.StraightDrawType type = Pioeval.smethod_27(ulong_0, ulong_1);

Edited by Che

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...