1. yes, since you are trying to pass arrays on the server side, Session is probably the preferred method,also seeNine Options for Managing Persistent User State in Your ASP.NET Application
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx2. if you mean reset the variable, then just do
string[] s = ....;s = null;otherwise, try
Array.Clear(s,0,s.Length);3. in this case, the array object's Length property is probably not what you want, you have to enumerate through the array, for examplestring[] a = new string[100]
...int n = 0;
for (int i=0; i < a.Length; i++)
if (a[i] != null)
n++;
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx2. if you mean reset the variable, then just do
string[] s = ....;s = null;otherwise, try
Array.Clear(s,0,s.Length);3. in this case, the array object's Length property is probably not what you want, you have to enumerate through the array, for examplestring[] a = new string[100]
...int n = 0;
for (int i=0; i < a.Length; i++)
if (a[i] != null)
n++;
解决方案 »
- 下面的字符串怎么用正则表达式,急!谢谢了
- 大家好,我问个安装包的
- 发布应用程序时候,检测安装framework的问题
- 求教如何在.NET中将EXCEL文件另存为HTML啊
- RangeValidator怎么不起作用了
- ****求一个SQL语句的写法****正解马上结贴****
- 小问题:怎么把 datagrid 改动的数据更新的数据库中?..在线等..
- 紧急求教:网站一运行就提示说没法访问一个runtimeError.log的错误
- 请问在C#中类似VB的trim语句(去除字符串头尾的空格)的语句是什么?急,在线等待!!
- 如何把窗口上下切分?
- 启动问题
- 公网IP改变后,会不会触发什么事件还是自己写监控程序?
ArrayList myArray = new ArrayList();
1. Session["myArray"] = myArray;
2. myArray.Clear();
3. myArray.Count;