CS0246: 找不到类型或命名空间名称“cs”

allenlee allenlee 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
别人的项目,没找到cs的定义。大家帮忙看看。



using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.CodeDom;

namespace gyjx
{
/// <summary>
/// _default 的摘要说明。
/// </summary>
public partial class _default : System.Web.UI.Page
{
cs.classbase mycls=new cs.classbase();
gentleyh.Class1 anquan=new gentleyh.Class1();
protected void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面

}

#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
this.ImageButton2.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton2_Click);

}
#endregion

private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
this.TextBox1.Text="";
this.TextBox2.Text="";

}

private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{



string jqm = anquan.getNicNumber();
jqm = anquan.Encrypt(jqm, anquan.se_yaoshi);

string sqls = "select * from bjpwd ";
mycls.Fill(sqls);
string zhengban = mycls.ds.Tables[0].Rows[0]["bjpassword"].ToString();
if (jqm.Equals(zhengban))
{
string struser = this.TextBox1.Text.Trim();
string strpwd = this.TextBox2.Text.Trim();
if (struser == "")
{
mycls.jsfull(this, "登陆名称不可以为空!");
return;
}
strpwd = anquan.Encrypt(strpwd, anquan.se_yaoshi);
string sql = "select m_ry.*,xw_rsda.state from m_ry,xw_rsda where state='0' and dlmc='" + struser + "' and dlpwd='" + strpwd + "'";
if (mycls.GetRowCount(sql) <= 0)
{
mycls.jsfull(this, "输入用户名或者密码错误,请重新输入!");
return;
}
// tcck();
mycls.GetRowRecord(sql);
this.Session["userid"] = mycls.dr["id"].ToString();//记录登陆用户ID
this.Session["dwid"] = mycls.dr["bz"].ToString();//记录登陆用户所在单位的ID
this.Session["usermc"] = mycls.dr["dwmc"].ToString();
this.Session["dlmc"] = mycls.dr["dlmc"].ToString();
this.Session["bz"] = mycls.dr["bz"].ToString();
this.Session["mesnum"] = "";
this.Session["mesname"] = "";

//记录登陆用户的中文名称

this.Response.Redirect("main.aspx");
}
else
{
mycls.jsfull(this, "不是正版,无法使用");
return;
}

//}
}

}
}

************************************************************************************
“/gjjx”应用程序中的服务器错误。
--------------------------------------------------------------------------------

编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误信息: CS0246: 找不到类型或命名空间名称“cs”(是否缺少 using 指令或程序集引用?)

源错误:



行 17: public partial class _default : System.Web.UI.Page
行 18: {
行 19: cs.classbase mycls=new cs.classbase();
行 20: gentleyh.Class1 anquan=new gentleyh.Class1();
行 21: protected void Page_Load(object sender, System.EventArgs e)

...全文

相关推荐

app_code内的类无法使用的排查

aspx文件,app_code内的类无法使用的排查 编译器错误消息 CS0246 找不到类型或命名空间名称“QPUtils”(是否缺少 using 指令或程序集引用)

Afterwards_

找不到类型或命名空间名称“Server”(是否缺少 using 指令或程序集引用?)

今天将webserice里面的一个代码,拷到一个C#类,结果运行编译错误。DataBase = Server.MapPath(“data.mdb”);报错:找不到类型或命名空间名称“Server”(是否缺少 using 指令或程序集引用?)但是我的确引用了名字空间using System.Web;为什么呢?因为Server的完整路径是System.Web.HttpContext.Current.Server。using System.Web是显然不够的;但是在从内置Page类继承的类中可以直接写Server.MapPath”data.mdb”),应该是因为Page类已经包含了这些类路径。由此总

weixin_38706294

VS2013通过NuGet导入程序包[可运行源码]

本文详细介绍了在Visual Studio 2013环境下,通过NuGet包管理器向C#工程导入第三方程序包的两种方法:在线添加和离线添加。在线添加可通过程序包管理器控制台输入指令(如安装ThoughtWorks.QRCode)或直接通过管理解决方案的NuGet程序包界面搜索安装。离线添加需先在工具菜单中打开NuGet包管理器,设置程序包源为本地路径,然后进行安装。最后,文章说明了如何将已下载的dll文件通过添加引用的方式手动添加到工程中,并展示了最终效果。内容适合C#开发初学者参考,帮助解决NuGet使用中的常见问题。

ppp33

C#版GDAL-1.11.1编译

本资源是在64位win7系统下亲测可行的,赶紧下载编译一遍吧。

贝尔拉梅拉热翔

Unity3d中使用HttpUtility

1、Unity3D引用System.Web.DLL打包发布的问题及解决 2、Unity3d中使用HttpUtility,如果直接在plugins中引入 System.Web.DLL的话,在对Unity3d项目打包的时候会报错,在U3D环境中,编译运行一切正常,但在打包发布(Build)为PC版本可执行文件时,却出现错误:“ArgumentException: The Assembly ********. But the dll is not allowed to be included or could not be found.” 3、这个包直接使用了System.Web的cs源码,不会出现打包dll的问题

PengQiuYuan_Fj
评论 6
收藏 已收藏
分享
返回顶部
allenlee
ASP 28,401 成员 356,940 内容