Skip to content

iQuantile-LLC/SharpSession

Repository files navigation

Sharp Session

Just in case someone needs session for Windows forms/WPF

Installation

It is recommended to use NuGet. F.ex through the VS Package Manager Console Install-Package iQuantile.DotLib.SessionManager or using the VS "Manage NuGet Packages..." extension.

How to use

Session is a static class. add reference.

using static SessionManager.SharpSession;

Start Session

SessionStart();
Session["A"] = 5;
int y = (int)Session["A"];

Special Methods

GET

In stead of type casting use GET("key"). this will work like (T)Session["key"]

Session["A"] = 5;

int x = Get<int>("A");

SET

In stead of type casting use SET("Key",value).this will store the data on Session[key]

Set("A", 10);
int y =  (int)Session["A"];

OTHER SESSION METHODS

SessionDestroy(); //destroys the session
SessionUnset();  //re initialize session
SessionReset(); //Sets all keys to null
            

RegenerateId();      // Creates new ID and appends to sessionID
int x = CreateId(); //Returns a new SessionID

OTHER PROPERTIES

public static int SessionId { get; set; } //Holds the session ID
public static string SessionName { get; set; } //Holds the session name

About

Session Class for Windows Forms/ WPF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published