locked
Error RRS feed

  • Question

  • User1979860870 posted

    Hi

    encdec - The name encdec does not exist in the current context.

    RequestPayload - The Type or Namespace could not be found

    JavaScriptSerializer - The Type or Namespace could not be found

    AuthResponse - The Type or Namespace could not be found

    byte[] _aeskey = encdec.generateSecureKey(); //common.RandomString(32); //
                string straesKey = Convert.ToBase64String(_aeskey);
                string encAppKey = encdec.Encrypt(_aeskey, public_key);
    
                RequestPayload aRequestPayload = new RequestPayload();
                aRequestPayload.action = "ACCESSTOKEN";
                aRequestPayload.username = "testacc";
                aRequestPayload.password = encPassword;
                aRequestPayload.app_key = encAppKey;
    
                JavaScriptSerializer serial1 = new JavaScriptSerializer();
                using (var streamWriter = new StreamWriter(request.GetRequestStream()))
                {
                    string json = serial1.Serialize(aRequestPayload);
                    streamWriter.Write(json);
                    streamWriter.Flush();
                    streamWriter.Close();
                }
                WebResponse response = request.GetResponse();
                string result = new StreamReader(response.GetResponseStream()).ReadToEnd();
                AuthResponse objresp = new AuthResponse();
                objresp = serial1.Deserialize (result);
                string DecryptedSek = Convert.ToBase64String(DecryptBySymmetricKey(objresp.sek, _aeskey));

    Thanks

    Thursday, February 4, 2021 4:06 PM

All replies

  • User1120430333 posted

    Either you don't have 'using' statements pointing to namespaces the class needs to use,  you don't have references to DLL(s) the namespaces are in or both

    Thursday, February 4, 2021 9:26 PM
  • User303363814 posted

    Fixing multiple errors is a recursive process.

    1) Fix the first error

    2) Recompile

    3) If there are errors go to step 1

    4) Done

    Is your first error 'The name encdec does not exist in the current context'?  If it is then - where do you declare 'encdec'?  To use a variable it has to be declared within scope.

    If one of the other errors you listed is the first error then concentrate on that one.  The messages that you have shown seem self explanatory.

    Fix the first error.  Repeat.

    Thursday, February 4, 2021 9:34 PM