c# - Cannot apply indexing with [] to an expression of type 'System.Collections.Specialized.NameValueCollection' -


i've tried under sun access appsettings , cannot work.

i've got class library needs access web appsettings. i've checked , there no 'system.collections.specialized.namevaluecollection' import.

anyone got ideas?

using system; using system.collections.generic; using system.configuration; using system.linq; using system.net.http; using system.text; using system.threading.tasks; using system.web; using system.web.configuration;  public static class httpresponsebase_setoauthfromcookie {     public static void setoauthfromcookie(this httpresponsebase response, string verify,                                           string token, string tokensecret,                                           string username,                                           bool istwitter)     {           string pas =  webconfigurationmanager.appsettings["cryptpass"],                crypt = ((verify.length > 3 ? (verify + ":") : "twit") + token + ":" + tokensecret).encrypt(pas);         //         var cookie = new httpcookie(username + (istwitter ? "twitter" : "linkedin"), httpserverutility.urltokenencode(convert.frombase64string(crypt)));         cookie.expires = datetime.now.adddays(1);         response.cookies.add(cookie);     }} 

enter image description here

i added reference system 4.0 , fixed .


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -