简体   繁体   中英

Saving value in ASP.NET Session variable

How can I save IntPtr value in Session variable? I could do this but How can I parse it back to IntPtr .

 IntPtr _intPtrVariable = IntPtr.Zero; 
 Session["ADUserToken"] = _intPtrVariable; 

You can value back from session like below:

if( Session["ADUserToken"] != null)
{
    IntPtr? sessionValue = Session["ADUserToken"] as IntPtr?;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM