-4

I working on a Client/Server application who use encryption system, RSA to negociate a passphrase and AES to dialog, the encryption is ok, when the encryption has been negotiate , i set the public variable encryption = Encrypt.AES;, send a string to server and listen for his answer. When client receive data i use a switch-statement by encryption

But, after a step-by-step debugging there is something strange, the switch-statement go to the wrong case.

step-by-step screen

Why the switch statement isn't working?

    public enum Encrypt
    {
        NONE, RSA, AES
    }
j08691
  • 204,283
  • 31
  • 260
  • 272
Dymerz
  • 153
  • 2
  • 9
  • 1
    try on debug mode, why are you debugging on release mode? there may be some optimizations going wrong. – M.kazem Akhgary Sep 11 '17 at 17:28
  • What do you mean by a "public variable"? Is it possible that you entered the switch statement prior to the field's value getting set? Also, is it possible that your program is functioning correctly but your symbols are out of sync so it looks like your debugging is at a different line than it really is executing? – StriplingWarrior Sep 11 '17 at 17:31
  • check if the enum doesnt have the same int value assigned to different enums. – Rand Random Sep 11 '17 at 17:33

1 Answers1

0

For a unknown reason it's working in Debug mode Thanks to M.kazem Akhgary :p

Dymerz
  • 153
  • 2
  • 9
  • glad you made it work, please read this post, there is the reason. use release mode when you finally finished your program and you want to release it. https://stackoverflow.com/questions/367884/what-is-the-difference-between-debug-and-release-in-visual-studio – M.kazem Akhgary Sep 11 '17 at 23:16