C#全局变量

如何得到当前登录用户Id?
创建一个保存全局变量的Globals类,声明一个全局变量CurrentId(public static int CurrentId ;);登陆的时候将登录用户的Id保存在CurrentId中;这样在任何一个类中就都可以访问Globals.CurrentId来得到当前的主键Id了。

猜你喜欢

转载自blog.csdn.net/pengfeixiong/article/details/8578672