using System;namespace Company
{
/// <summary>
/// GlobalObject 的摘要说明。
/// </summary>
public class GlobalObject
{
private static GlobalObject go=null;
private string username=null;
private string userid=null;
private string userPrivilege=null;
private GlobalObject()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public static GlobalObject GetInstance()
{
if (go==null)
{
go=new GlobalObject();
}
return go;
}
public string UserName
{
get
{
return username;
}
set
{
username=value;
}
}
public string UserId
{
get
{
return userid;
}
set
{
userid=value;
}
}
public string UserPrivilege
{
get
{
return userPrivilege;
}
set
{
userPrivilege=value;
}
} }
}调用
Company.GlobalObject