ahm*_*md0 3 c# asp.net static static-members
我知道静态类变量在C++类中做了什么,我不太清楚的是用于ASP.NET Web应用程序的C#类中的静态类变量的生命周期.这是一个代码示例:
namespace MyWebApp
{
public static class MyFunctions
{
private static string _cachedID;
public static string getID(string strValue)
{
if(_cachedID == null)
_cachedID = strValue;
return _cachedID;
}
}
}
Run Code Online (Sandbox Code Playgroud)
有人可以用简单的英语为我解释一下吗?
| 归档时间: |
|
| 查看次数: |
2273 次 |
| 最近记录: |