缺少引用程序集 关于sizeof()??

isabel_cui 2008-11-25 10:58:25
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Siemens.BPM.Profile.Web.UI;

using System.Diagnostics;
using Siemens.BPM.Profile.Entities;
using Siemens.BPM.Profile.Services;
using System.Collections;
using System.Collections.Generic;
using System.Text;

string employeenos = Session["EmployeeNos"].ToString();
if (employeenos != "")
{
int i;
string employeenames;
string[] employeenosarray;
employeenosarray = employeenos.Split(',');
employeeService = new EmployeeService();
for (i = 0; i < sizeof(employeenosarray); i++)
{
Siemens.BPM.Profile.Entities.Employee employee = employeeService.GetByEmployeeNo(employeenosarray[i].ToString());
employeenames += employee.DisplayName.ToString();
this.txtFunctionLeader.Text = employeenames;
}

}
else { this.txtFunctionLeader.Text = ""; }


"Error 4 The type or namespace name 'employeenosarray' could not be found (are you missing a using directive or an assembly reference?)"
不知道是缺了引用什么???
...全文
132 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
isabel_cui 2008-11-25
  • 打赏
  • 举报
回复
Response.Write("<script language=javascript> window.opener.location.href=window.opener.location.href; window.opener.location.reload(true); window.opener='null';window.close();</script>");

顺便再问个问题,我想在子窗口刷新父窗口,但会跳出要求retry的对话框,retry之后才可以刷新,怎么才能避免??以上是我的代码。
isabel_cui 2008-11-25
  • 打赏
  • 举报
回复
貌似改成 .length就好了。。。
isabel_cui 2008-11-25
  • 打赏
  • 举报
回复
No overload for method 'GetLength' takes '0' arguments
谢谢阿,int arraylen = employeenosarray.GetLength();
可是,这样之后又出现上面那个错误了。。。
  • 打赏
  • 举报
回复
C# 语言参考
sizeof(C# 参考)

用于获取 值类型 的字节大小。例如,可以如下所示检索 int 类型的大小:

sizeof 运算符仅适用于值类型,而不适用于引用类型。
  • 打赏
  • 举报
回复
http://msdn.microsoft.com/zh-cn/library/eahchzkf(VS.80).aspx
你看看这个再决定是否用sizeof好吧
array是引用类型,不是值类型,然后你不就是想获取array的长度吗?它有length属性的啊
isabel_cui 2008-11-25
  • 打赏
  • 举报
回复
没有,我只是把相关的贴出来了
hztltgg 2008-11-25
  • 打赏
  • 举报
回复
事件驱动的,代码不是和asp一样从头执行到尾。
双击页面,把这些代码放到load事件里去
hztltgg 2008-11-25
  • 打赏
  • 举报
回复
你的这些代码就这么放在外面的?没有包含到类的方法里?

111,131

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧